Add Request Soft Update algorithm for use by other specifications - #1847
Add Request Soft Update algorithm for use by other specifications#1847monica-ch wants to merge 4 commits into
Conversation
|
@yoshisatoyanagisawa Will you take a look at this change? @Brandr0id FYI |
b7087fb to
a805c0d
Compare
|
I have two main concerns regarding exporting the
Because external callers like FedCM genuinely need to fetch the latest script, relying on Therefore, I suggest we introduce and export a wrapper algorithm (e.g., This wrapper algorithm could do the following:
What do you think? |
Add the export attribute to the Soft Update dfn so external specifications (FedCM, Payment Handler) can reference it as a stable primitive. Add two clarifying Notes for external callers: the algorithm is fire-and-forget, and repeated calls are collapsed by the job queue via job equivalence. Part of w3c#1846.
a805c0d to
5d9896d
Compare
Replace ambiguous throttling and ignoring terminology with explicit algorithm control flow, and clarify when concurrent invocations may be coalesced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e60256f0-04fc-4a2f-b93c-ca14f2fea252
Express the user agent's optional refusal as an explicit early return and move coalescing, rate limiting, and caller expectations into an explanatory note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e60256f0-04fc-4a2f-b93c-ca14f2fea252
|
.
Agreed and make sense. Thanks for the feedback @yoshisatoyanagisawa. I reworked this to export a It takes a storage key because callers such as FedCM may not have an environment available, but can supply the UA-derived storage key for the request. The wrapper enforces a match with the registration and gives the UA discretion to decline, rate-limit, or coalesce update requests. Callers therefore cannot assume every invocation triggers an update check. @Brandr0id could you confirm that this best-effort contract works for the FedCM identity-handler flow? |
yoshisatoyanagisawa
left a comment
There was a problem hiding this comment.
LGTM with comments.
Expose the optional force-bypass-cache input and clarify when a user agent may limit update-check frequency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e60256f0-04fc-4a2f-b93c-ca14f2fea252
Part of #1846.
Change
Introduces a new exported
Request Soft Updatealgorithm. The existingSoft Updateremains unexported — external specifications must go through the wrapper.Design decisions
environment settings object(it operates from UA-side code), sostorage keyis the only workable input type.Soft Updateis not exported. Callers must go through the wrapper. This ensures the storage-key check and UA-discretion clause always apply to external calls.forceBypassCacheis optional. It defaults tofalse, but calling specifications can request cache bypass when their use case requires it.Adoption implications
(registration, requestingStorageKey, forceBypassCache = false)becomes an implicit stability commitment.Request Soft Updatedirectly.Related
Register a Service Worker)Unregister Service Workers)Preview | Diff