Skip to content

docs(delete-user-data): say functions deploy to us-east1 unless a region is set - #3277

Open
CorieW wants to merge 3 commits into
kitsfrom
fix/kits-delete-user-data-region-docs
Open

CorieW wants to merge 3 commits into
kitsfrom
fix/kits-delete-user-data-region-docs

Conversation

@CorieW

@CorieW CorieW commented Oct 20, 2026

Copy link
Copy Markdown
Member

Corrects the kit README, which said the functions deploy to us-central1 when no region is set. The Firebase CLI deploys them to us-east1. Fixes #3252. The kit still sets no region. Related: #3276 adds a similar note for setGlobalOptions({ maxInstances }).

Changes

  • README: the "Functions deploy to …" section now says the functions land in us-east1 unless you set a region. It recommends keeping them in the same region as the Firestore database and shows how to set the region: call setGlobalOptions({ region }) in its own file and import that file before the kit. A call in the entry file itself runs too late in an ES module, because import / export … from load the kit first. It also points to firebase functions:kits:install / ext:migrate, which generate an entry file that sets region from FUNCTION_DEFAULT_REGION.
  • README Usage: a short pointer to that section.
  • CHANGELOG entry.
  • tests/region.test.ts: the kit sets no region on its three functions, and setGlobalOptions({ region }) called before the kit loads applies to all three.

Testing

On a test project, each instance with its own nam5 Firestore database, config FIRESTORE_PATHS=rec/{UID}, FIRESTORE_DELETE_MODE=recursive, auto-discovery off:

  • extension firebase/delete-user-data@0.1.30;
  • the kit from kits @ 1c7b047, set up as the old README says (CommonJS index.js re-exporting the functions, no region);
  • the same kit set up exactly as the new README says: TypeScript, compiled as an ES module ("type": "module"), with options.ts setting region: "us-central1" and imported first by index.ts.

For each run I seeded rec/<uid> plus 20,000 docs in rec/<uid>/items, created and deleted the Auth user, and counted what was left about 100s later.

Extension Kit before Kit after
Region us-central1 us-east1 us-central1
Items left (4 runs, 3 for "after") 0 each time 0 each time 0 each time
clearData recursive delete time 49–56s 40–41s 40s
  • I couldn't reproduce the timeouts reported in the issue: the kit deleted all 20,000 docs from us-east1, about as fast as from us-central1. I've updated the issue to say so.
  • Locally, with an ES module entry, setGlobalOptions in the same file left __endpoint.region unset, and a separate options module set it to ["us-central1"]. TypeScript compiled to CommonJS keeps the order, so the same-file call also works there.
  • vitest run: 16 files, 121 tests pass. Prettier passes on the changed files (the README's existing tables already fail it). pnpm build fails on kits with TS2688: Cannot find type definition file for 'node' because @types/node isn't installed. That isn't caused by this change, and tsc passes with @types/node available.

…ion is set

The README said the kit's functions deploy to us-central1 when no region is set. The Firebase CLI deploys them to us-east1. Document how to set the region with setGlobalOptions in a file imported before the kit, and add a test that the kit sets no region and follows global options.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to clarify that functions deploy to us-east1 by default unless a region is configured, and provides instructions on how to set the region using setGlobalOptions. It also adds a new test suite (region.test.ts) to verify region configuration behavior. The review feedback recommends adding an afterEach block to reset the global options in the tests to prevent test pollution and ensure proper isolation.

Comment thread kits/delete-user-data/tests/region.test.ts
Comment thread kits/delete-user-data/tests/region.test.ts Outdated
Comment thread kits/delete-user-data/README.md Outdated
Comment thread kits/delete-user-data/README.md Outdated
Comment thread kits/delete-user-data/README.md Outdated
Comment thread kits/delete-user-data/README.md Outdated
Comment thread kits/delete-user-data/tests/region.test.ts Outdated
Comment thread kits/delete-user-data/README.md Outdated
@CorieW
CorieW marked this pull request as ready for review October 27, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant