Repository navigation
feat(live): admit the Messaging SDK and its hosts under the live register - #2297
Merged
Merged
Conversation
…ster Plan step M-9 for #2114. @firebase/messaging and @firebase/installations join LIVE_ROW_SDK_PACKAGES, and firebaseinstallations.googleapis.com and fcmregistrations.googleapis.com join LIVE_ROW_HOSTS. firebase/messaging and firebase/messaging/sw leave PASS_THROUGH_HOSTS, and Remote Config lists only its own host, since Installations now passes as a live row host. An http.request to either Messaging host is refused with its own reason and remedy. The tests stop naming firebase/messaging as the unserved example: the pass-through and alias cases use firebase/remote-config, and Remote Config keeps the @firebase/installations case. Tests written first and run against main's code, 6 failures: - the derived package probe lists @firebase/installations and @firebase/messaging that LIVE_ROW_SDK_PACKAGES lacks; - Installations and FCM registrations are refused as Google endpoints with no list, a fetch from an SDK file to registrations is refused, and an https.request gets the generic live reason; - passThroughHosts(['firebase/remote-config']) still names Installations; - a loaded SDK file cannot reach @firebase/installations with only firebase/functions listed. No runtime path until M-10 serves firebase/messaging as a row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets the live register load the Messaging SDK's packages and lets that SDK's
fetchreach Installations and FCM registrations with no pass-through list, ahead of the Messaging rows in M-10 (#2114).An app's own
fetchto either host is still refused (TypeError: fetch failed), and anhttps.requestto either is refused with a reason that namesfirebase/messaging.@firebase/messagingand@firebase/installationsare packages the live rows loadLIVE_ROW_SDK_PACKAGESinswap-or-stop.tsgains both. The derived test inlive-row-sdk-packages.test.tsnow probesfirebase/messagingandfirebase/messaging/swtoo, and the probe resolves exactly those two new packages. The Vite page gate reads the same set, so a file the rows or a pass-through loaded may now import@firebase/installationswith no list.Remote Config still passes through, reaching Installations as a live row host
Remote Config is the other service that reaches Installations. With
firebase/remote-configlisted, its entry,@firebase/remote-configand@firebase/installationsstill load from SDK files only, its own host stays caller-checked, and its SDK'sfetchto Installations passes while the app's ownfetchthere is refused. A new test inlive-register-pass-through.test.tscovers this. Remote Config's Installations calls stay unobserved, as before.Risk
net/tlsfrom any caller, as the other live row hosts do. Thefetchwrapper and the request check still refuse the app's ownfetchandhttp.request. The header comment oflive-net-guard.tssays this.firebase/messagingstill passes through on both planes until M-10 makes it a row. Between this PR and M-10 a listedfirebase/messagingloads as before, and its hosts pass as live row hosts instead of as pass-through hosts.vite-supplied-rows.test.tsis dropped, as the plan says for M-9. M-10 brings it back as a row case if the gate needs it.Integration test: none. This change has no runtime path until M-10 serves
firebase/messagingas a row, and scenarios reach loopback only, so the production-host verdict stays unit evidence.Implementation notes
Files (5):
packages/cli/src/register/swap-or-stop.ts,packages/cli/src/register/live-net-guard.ts,packages/cli/test/register/live-row-sdk-packages.test.ts,packages/cli/test/register/live-register-pass-through.test.ts,packages/cli/test/serve/vite-supplied-rows.test.ts.PASS_THROUGH_HOSTSkeepsfirebase/functionsandfirebase/remote-config(its own host). The Messaging, Analytics and Performance entries listed only the Messaging hosts or Installations, which are live row hosts now, so they are gone;passThroughHostsalready answers[]for an unlisted specifier.http.requestto either Messaging host: its own reason and remedy (MESSAGING_REQUEST_REASON,MESSAGING_REQUEST_REMEDY), not the Firestore, Auth and App Check remedy.firebase/functionsandfirebase/remote-configas the passed-through and unlisted examples, andfirebase/remote-configas the alias target.Tests written first, run against main's code: 6 failures (the package probe lists the two new packages; both hosts refused with no list; a
fetchto registrations from an SDK file refused; thehttps.requestrefusal had the generic reason; Remote Config's host list still named Installations;@firebase/installationsunreachable from a loaded file with onlyfirebase/functionslisted). With the change:packages/live/test/pass-through.test.ts: 11 pass.bun run typecheckinpackages/cli: clean. Conformance coupling gate: exit 0 (no engine or registry change).