Skip to content

Conversation

@colerogers
Copy link
Contributor

Copy link
Contributor

@blidd-google blidd-google left a comment

Choose a reason for hiding this comment

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

LGTM besides minor nit

export function createSnapshotFromProtobuf(data: Uint8Array, path: string, databaseId: string) {
if (!firestoreInstance) {
firestoreInstance = firestore.getFirestore(getApp());
firestoreInstance = firestore.getFirestore(databaseId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, why aren't you conditioning on firestoreInstance here like in createBeforeSnapshotFromBeforeProtobuf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean conditioning on databaseId right?

Because these two *fromProtobuf functions are only called from the V2 handler and V2 events always supply the databaseId

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.

[functions]: v2 change events and creation shapshots not referencing named database it was triggered on

2 participants