Skip to content

Conversation

@fredzqm
Copy link
Contributor

@fredzqm fredzqm commented May 8, 2020

See go/rtdb-multi-region-function-sdk

Multi-region realtime database will be served under different domains. In order to make sure the DataSnapshot returned by the function handler can connect to the appropriate RTDB, the backend will provide domain field in the pubsub payload.

resource: {
name: 'projects/_/instances/other-subdomain/refs/foo'
},
domain: 'firebaseio-staging.com'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying with the multi-region path. However, it didn't work due to a bug in the admin SDK.
I will fix that separately. For now, this will unblock testing in staging at least.

@fredzqm
Copy link
Contributor Author

fredzqm commented May 8, 2020

@laurenzlong
After talking with Ana, it looks like the data and resource are processed in some special ways that I didn't understand much.
However, any other fields in the pubsub payload will be visible as part of the context (similar to auth). The easiest and cleanest way, IMO, is to supply a domain field.

The JS SDK right now has a bug parsing the multi-region domain, but it has no problem understanding the staging domain.
I will work on a fix in the JS SDK and update the dependencies here in a follow up CL.

/cc @sarajmunjal

@fredzqm
Copy link
Contributor Author

fredzqm commented May 8, 2020

Move to private repos.

@fredzqm fredzqm closed this May 8, 2020
mbleigh pushed a commit that referenced this pull request Jun 2, 2020
@fredzqm fredzqm deleted the fz/region-domain branch May 24, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants