Repository navigation
fix(delete-user-data): validate EXT_SELECTED_EVENTS and EVENTARC_CHANNEL at deploy - #3286
Merged
Merged
Conversation
firebase-admin splits a string allowlist on commas without trimming, so a hand-written list with spaces after the commas only allowed the first type. Split and trim the list before opening the channel, and treat a whitespace-only value as unset.
Contributor
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where spaces in the EXT_SELECTED_EVENTS environment variable caused event types to be silently dropped. The list is now split, trimmed, and filtered to remove empty entries before being passed to firebase-admin. Additionally, the documentation, changelog, and tests have been updated to reflect and verify these changes. There are no review comments to address, so I have no feedback to provide.
CorieW
commented
Oct 27, 2026
CorieW
commented
Oct 27, 2026
CorieW
marked this pull request as ready for review
October 27, 2026 16:19
CorieW
marked this pull request as draft
October 27, 2026 16:20
…nstead of trimming The extension's install failed on spaces, wrong case, unknown types, duplicates or ';'. Validate the list at module load, next to assertRequiredParams(), so the deploy fails the same way.
…ension rejected Keep the skipped-empty-entries case, expect a throw for wrong case, unknown types, duplicates and ';', and check that importing the kit with a bad value fails.
…nd a malformed channel
The extension's install rejected both ("Must specify eventarc channel if allowing some events to be emitted"); the kit silently turned events off.
…data-selected-events-spaces # Conflicts: # kits/delete-user-data/CHANGELOG.md # kits/delete-user-data/src/index.ts # kits/delete-user-data/tests/index.test.ts
…data-selected-events-spaces
…or an unsupported location
… a duplicate first, as the extension did
CorieW
marked this pull request as ready for review
November 10, 2026 10:45
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.
Validates
EXT_SELECTED_EVENTSandEVENTARC_CHANNELwhen the kit loads, so values the extension's install rejected now fail the deploy instead of silently dropping events. Before, firebase-admin split the list on,without trimming, soa, b, cpublished onlya, and typos or wrong case were dropped without a warning. Fixes #3259.Changes
selectedEventTypes()runs at module load and fails the deploy, as the extension's install did, if:EXT_SELECTED_EVENTSentry has spaces or wrong case, isn't one of the three event types, or is repeated (repeats are reported first, as the platform did);EVENTARC_CHANNELis unset or empty;EVENTARC_CHANNELisn't a fullprojects/<project id>/locations/<location>/channels/<channel id>name, is in another project (GCLOUD_PROJECT), or isn't in one of the CLI'sALLOWED_EVENT_ARC_REGIONS. This is checked even with no event types selected, as on the extension.,a,,b,) are still skipped, and an empty value still publishes nothing.setupEventChannelpasses the validated array tochannel().Testing
On a test project with firebase-tools 15.31.0, I compared
firebase/delete-user-data@0.1.30with the kit from this branch. Extension values were sent withvalidateOnly=true, as the CLI sends them. Kit values were deployed with--dry-run, and every rejected value also as a real deploy, which failed and created nothing.All 66 values were accepted or rejected the same way. Error wording differs but names the same entries. "Kit before" comes from the code on
kits; thea, b, cand whitespace-only rows were also checked live.A selection (
a=firebase.extensions.delete-user-data.v1.firestore,b=…database,c=…storage):a,b,c,,a,,b,c,,,, empty, unseta, b, c' b'and' c'"is not listed in the extension spec"' b'and' c'"is not one of …"" a,b "," "," , ,", wrong case,a;bbogus,bbogusnot listedbogusnot one ofa,a/, extra segment), with typeslocations/<l>/channels/<c>us-central1for a bare id)europe-west1,us-east1,global, a bogus regionus-central1,us-west1,europe-west4,asia-northeast1Then I deployed both with a recorder function on my own channel and deleted a test user ("kit before" is again from the code):
GCLOUD_PROJECTis set at deploy, in deployed functions and in the emulator, so the project check runs in all three.pnpm testpasses (190 tests) and Prettier passes.tsc -bpasses with@types/nodetemporarily installed; without itpnpm buildfails, which this change doesn't cause.