Repository navigation
fix(daemon): bind runtime hints from one app resolution and clear replaced ones - #5029
Conversation
… accessor SessionStore had getRuntimeHints for the hints and getStoredRuntimeHints for the same map entry with its bound app. getRuntimeHints now returns the stored entry, and callers that need only the hints read its hints field.
An open bound stored hints to the app id its launch outcome reported, but a later open compares the binding with the id it resolves for its target before the launch. When the two differed for the same target, a reopen of the app the hints were applied to opened it without them. The binding now uses the id the open resolved before the launch, the same id the hints were applied to and the one a later open compares.
…d to An open with new transport hints for another app stored the new hints for that app and rebound them, but left the old hints written in the app they had been applied to. Nothing cleared them later: close and runtime clear target the app the stored hints are bound to. When an open replaces hints bound to another app, it now clears them from that app before it applies the new ones, through the open plan that admits both the apply and the clear operation. Reopening the same app with new hints writes over the old ones without a clear, and hints that no open applied are not cleared. The open plan carries the stored hints with their app as one value.
… they change Three gaps in how an open rebinds and clears stored hints: - An open whose target resolves to no app id before the launch, such as a deep link with no current app, left the hints unbound, so a later open of another app applied them again. The binding now falls back to the app the launch reports. - The clear of the previous app ran before the new app's launch. When the apply or the launch failed, the previous app lost its hints while the session still bound them to it. The clear now runs after the launch succeeds, before the binding moves. An open without transport hints still clears before its launch. - A connection that attaches the same runtime hints to every request made each app switch clear the previous app. Identical transport hints leave nothing stale there, so only different hints clear it.
|
Thanks for the fix. The code at c083dc7 is ready to merge, and the required evidence is in place. The only non-passing checks are two superseded runs of the PR-body lint, both cancelled, and they do not touch the daemon code in this diff. The other 16 checks pass, and there are no conflicts. Not blocking, and each can be taken or left: (1) with |
… them to - After a successful open that applies hints to another app, the open now clears the previously bound app whatever the values are. Identical hints left that app holding native hints with no binding left to clear them. - The session and the hint binding now take one app id: the prepared id, else the id the launch reports. Every platform reports the prepared id back when there is one, and Android fills one in only for a target without it. A later deep-link or targetless open resolves from the session id, so it now compares the same id the binding holds. - A failed removal from the replaced app no longer fails an open that already launched. The open reports it as a warning and binds the new hints.
|
|
Thanks for the quick follow-up. The new commit a666d77 closes the three earlier notes, keeps one app resolution per binding, and leaves no stale runtime hint unreported when an app is replaced. CI is green at this commit (15 checks, none failing), and no conflicts are known. Not verified here: tests and the live iOS simulator run were not re-executed for this delta, but the earlier live evidence still applies because the change only adjusts when the already-validated native clear runs and makes it best-effort. This is ready for maintainer review. |
Summary
Follow-up to #5010, from its review notes.
runtime clearcleared only the new app. A failed launch leaves them in place. A failed removal is a warning in the open result, not a failed open. Reopening the same app writes over them.SessionStore.getRuntimeHintsreturns the hints with their app;getStoredRuntimeHintsis gone.Before / after
iPhone 17 Pro simulator, then
simctl spawn <udid> defaults read com.apple.mobilesafari RCT_jsLocation:Validation
a666d77c1,check:affected --run --head,exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related pass.check:command-docs,check:doc-linksandcheck:doc-prosepass.session-open-runtime.test.tscover each rule above, and a mutant of each new guard fails one of them.