Skip to content

fix(delete-user-data): match the extension's cpu, concurrency and ingress - #3276

Merged
CorieW merged 4 commits into
kitsfrom
fix/kits-delete-user-data-gen1-runtime-options
Oct 27, 2026
Merged

CorieW merged 4 commits into
kitsfrom
fix/kits-delete-user-data-gen1-runtime-options

Conversation

@CorieW

@CorieW CorieW commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Pins the extension's concurrency: 1, cpu: "gcf_gen1" and ingressSettings: "ALLOW_INTERNAL_ONLY" on all three kit functions, so auto-discovery no longer runs handleSearch out of memory and silently skips deletions. Fixes #3250.

Follows #3209 (firestore-bigquery-export) and #3233 (firestore-send-email). #3206 sets concurrency and ingress for this kit but not cpu, and is open with conflicts, so this lands the delete-user-data part on its own; #3206 can drop this kit.

Changes

  • clearData, handleSearch and handleDeletion declare concurrency: 1, cpu: "gcf_gen1" and ingressSettings: "ALLOW_INTERNAL_ONLY".
  • README: notes the matching runtime settings, and the remaining max-instances difference with how to raise it (setGlobalOptions({ maxInstances }) before loading the kit).
  • CHANGELOG entry.
  • Test that each function's __endpoint has the three options.

Testing

Deployed side by side on a test project, each with its own Firestore database: extension firebase/delete-user-data@0.1.30, the kit from kits @ fcdd555, and the kit from this branch. Same config for all: auto-discovery on, depth 1, default search fields, shallow mode, no paths. Each database has 20 root collections × 2,500 docs (~2 KB each) plus one doc per collection owned by the test user. I then created and deleted the user and counted the user's docs about 3 minutes later. Two runs:

Extension Kit before Kit after
Concurrency 1 80 1
CPU 1st gen, 256MB 1 0.1666
Ingress ALLOW_INTERNAL_ONLY ALLOW_ALL ALLOW_INTERNAL_ONLY
Max instances 3000 100 (default) 100 (default)
User docs deleted, run 1 20/20 0/20 20/20
User docs deleted, run 2 20/20 1/20 20/20
handleSearch failures none 1 × Memory limit of 256 MiB exceeded, 18–19 × "The request failed because ... connection to the instance had an error" per run none
  • With internal-only ingress, the kit still receives the Auth deletion event (clearData) and both Pub/Sub topics (20 handleSearch and 20 handleDeletion requests per run).
  • The 100-instance cap didn't matter here (20 searches per deletion), so it is left at the default and documented.
  • vitest run: 122 tests pass. Prettier passes on the changed files. tsc passes once @types/node is available; the kit's tsconfig lists it, but it isn't installed on kits, so pnpm build fails there with or without this change.

…ress

The kit's functions took the 2nd gen defaults (concurrency 80, 1 vCPU,
ALLOW_ALL). With auto-discovery on, one 256MiB handleSearch instance took
many searches at once, ran out of memory and dropped them, so user data
was left undeleted. Pin concurrency 1, cpu gcf_gen1 and internal-only
ingress on clearData, handleSearch and handleDeletion.

Fixes #3250

@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 configures the clearData, handleSearch, and handleDeletion functions in the delete-user-data kit to run with specific runtime settings (concurrency: 1, cpu: "gcf_gen1", and ingressSettings: "ALLOW_INTERNAL_ONLY"). This aligns their behavior with the 1st generation extension settings and prevents out-of-memory errors caused by the 2nd generation defaults (such as concurrency of 80). The changes also include updates to the documentation, changelog, and unit tests to verify these configurations. There are no review comments, so I have no feedback to provide.

Comment thread kits/delete-user-data/src/index.ts
Comment thread kits/delete-user-data/README.md
Comment thread kits/delete-user-data/tests/index.test.ts
@CorieW
CorieW marked this pull request as ready for review October 27, 2026 11:41
Comment thread kits/delete-user-data/src/index.ts Outdated
@CorieW
CorieW merged commit 21799db into kits Oct 27, 2026
11 checks passed
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.

2 participants