Skip to content

fix(firestore-bigquery-change-tracker): preserve BigQuery project on view updates, release 2.2.1 - #3137

Merged
cabljac merged 3 commits into
nextfrom
fix/tracker-2.2.1-view-project
Sep 7, 2026
Merged

fix(firestore-bigquery-change-tracker): preserve BigQuery project on view updates, release 2.2.1#3137
cabljac merged 3 commits into
nextfrom
fix/tracker-2.2.1-view-project

Conversation

@cabljac

@cabljac cabljac commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of da21982 from #3121 (Corie's fix, approved by Izaak) onto next, plus the 2.2.1 version bump and changelog entry. #3121 targets kits, but the tracker is published from next, so the fix never reached npm from there.

The bug: initializeLatestView builds the snapshot query for an existing _raw_latest view without bqProjectId, so buildLatestSnapshotViewQuery falls back to process.env.PROJECT_ID. That variable is only set for extensions. On a kit the view query became undefined.<dataset>.<table> and the initBigQuerySync task failed in afterFirstDeploy. The create path already passed the project. The fix passes bq.projectId on the update path too, matching the create path.

Tests: the materializedViews suites pass locally (20 tests), including the new one that sets process.env.PROJECT_ID to a decoy and asserts the query uses the BigQuery project. Not verified against a live redeploy.

After merge, dispatch npm_publish_bq_scripts.yml for 2.2.1, then regenerate the kit shrinkwrap in the stack so the rc pins it.

Fixes #3120

@cabljac
cabljac requested a review from a team as a code owner September 7, 2026 17:05

@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 firestore-bigquery-change-tracker package to version 2.2.1. It fixes an issue where updating an existing _raw_latest view failed on plain Cloud Functions because the snapshot query builder dropped the bqProjectId parameter, causing it to fall back to process.env.PROJECT_ID (which is undefined outside of extensions). The fix explicitly passes bqProjectId: bq.projectId when initializing the latest view, and a corresponding unit test has been added to verify this behavior. There are no review comments, so I have no feedback to provide.

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.

🐛 [@firebase-function-kits/firestore-bigquery-export] afterFirstDeploy taskqueue initialization failed from missing PROJECT_ID

2 participants