Skip to content

decision(delete-user-data): kit/extension parity – event source is per function, not per instance #3255

Open

Description

@CorieW

delete-user-data kit/extension parity. Priority: low. Event subscribers that filter on source stop matching.

Difference

  • Extension: every event has one source per instance: //firebaseextensions.googleapis.com/extensions/projects/<p>/instances/<id>.
  • Kit: source is the publishing function, projects/<p>/locations/<region>/services/kit-<id>-<function>, so one instance emits three different sources (clearData, handleSearch, handleDeletion). Types and payloads are identical. The kit README already documents this.

Reproduced

Captured events from both sides on the same channel: the type and data match, and only source differs, as described above.

Code

  • Extension: the platform sets EVENTARC_CLOUD_EVENT_SOURCE per instance; publishes at index.ts#L106.
  • Kit: no source passed, so firebase-admin uses the CLI's per-function EVENTARC_CLOUD_EVENT_SOURCE (events.ts#L58-L66); documented in README.md#L205-L216.

Resolution

Two options:

  • Pass one source per instance in publishDeletionEvent (firebase-admin uses event.source when it's set), so subscribers can still filter on one instance.
  • Keep the documented behaviour and record it as an accepted difference under "Decisions" in delete-user-data kit tracking issue #3249.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    decisionNeeds a decision before work can proceedkitsparity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions