WICG / WICG/install-element

How to best surface data errors

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
21
Forks
4
Avg merge
3d 18h
Merged PRs (30d)
4

Description

Current implementation:
The WebInstallServiceResult is provided from WebInstallServiceImpl to HTMLInstallElement::OnInstallResult(). WebInstallServiceResult has 3 possible results: kSuccess, kAbortError, and kDataError.

Proposal: Good to keep as is

The question is how do we want to handle kDataError. Options to consider (but open to more ideas):

  • Fire promptdismiss (same as kAbortError)
    • Probably difficult for developers to differentiate from kAbortErrors and kDataErrors and take appropriate actions.
  • Update and add new invalidReason (existing read-only InPagePermissionMixinBlockerReason that will block the element from being activated. Potential name: install_data_invalid (Naming not finalized).
  • Do both A and B.
  • Create a new read-only InPagePermissionMixinBlockerReason similar to invalidReason, such as installDataInvalid. (Naming not finalized).
  • Create a new Event and event handler similar to promptdismiss and onpromptdismiss, such as promptinvalid since data errors are typically also a result of a user interaction. (Naming not finalized).

NOTE: WebInstallServiceResults are mapped to install_result_code.h - Chromium Code Search

  • kSuccess
    • InstallResultcode::kSuccess
    • InstallResultcode:: kSuccessAlreadyInstalled
  • kAbortError
    • InstallResultCode::kUserInstallDeclined - User declines install or launch dialog
    • Render frame host is null
    • file:// or chrome:// urls used
    • Permission denied by user (in content settings or page info)
    • Unsupported profiles (Incognito or guest mode)
    • Current web contents is being installed via another method
    • Default for all other unexpected failures such as the browser crashing, network issues, etc.
  • kDataError
    • InstallResultCode::kNoCustomManifestId - For . No custom manifest id found in the manifest loaded from the provided install_url.
    • InstallResultCode::kManifestIdMismatch - For
    • InstallResultCode::kInstallURLLoadFailed - WebAppUrlLoader failed to load installurl
    • InstallResultCode::kInstallURLRedirected - A redirecting installurl was used which currently isn’t supported. See crbug.com/471021583
    • InstallResultCode::kNotValidManifestForWebApp - No valid manifest found
    • InstallResultCode::kNotInstallable - Web App is not considered installable, i.e. missing manifest fields, no service worker, etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing WebInstallServiceResult from WebInstallServiceImpl to HTMLInstallElement::OnInstallResult(), then review the existing promptaction, promptdismiss, and invalidReason behavior in the linked PEPC specification. Compare the listed kDataError handling options with the mappings in install_result_code.h; done requires a documented decision for how data errors are surfaced and which API behavior follows.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.