fix(firestore-bigquery-change-tracker): preserve BigQuery project on view updates, release 2.2.1 - #3137
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
This was referenced Sep 7, 2026
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.
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 targetskits, but the tracker is published fromnext, so the fix never reached npm from there.The bug:
initializeLatestViewbuilds the snapshot query for an existing_raw_latestview withoutbqProjectId, sobuildLatestSnapshotViewQueryfalls back toprocess.env.PROJECT_ID. That variable is only set for extensions. On a kit the view query becameundefined.<dataset>.<table>and theinitBigQuerySynctask failed inafterFirstDeploy. The create path already passed the project. The fix passesbq.projectIdon 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_IDto a decoy and asserts the query uses the BigQuery project. Not verified against a live redeploy.After merge, dispatch
npm_publish_bq_scripts.ymlfor 2.2.1, then regenerate the kit shrinkwrap in the stack so the rc pins it.Fixes #3120