Skip to content

Fix database:remove bug - #3186

Merged
fredzqm merged 4 commits into
masterfrom
fz/rm-fix
Mar 4, 2021
Merged

Fix database:remove bug#3186
fredzqm merged 4 commits into
masterfrom
fz/rm-fix

Conversation

@fredzqm

@fredzqm fredzqm commented Mar 4, 2021

Copy link
Copy Markdown
Contributor

In listRemove.ts, const paths = Object.keys(res.body); fails if res.body is null.
This is causing errors when listing a path already deleted.

This bug was introduced in #2828.

@google-cla google-cla Bot added the cla: yes Manual indication that this has passed CLA. label Mar 4, 2021
@fredzqm
fredzqm requested a review from yuchenshi March 4, 2021 06:36
Comment thread src/utils.ts Outdated
urlObj.hostname.includes("firebaseio.com") ||
urlObj.hostname.includes("firebasedatabase.app")
) {
if (urlObj.hostname.includes("firebase")) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So that FIREBASE_REALTIME_URL=https://firebaseio-staging.com will work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's just list all three full domain names to be on the safe side. myfirebaseapp.example.com should be filtered out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a way to detect emulator specific url instead? It might be cleaner.
Are they always "localhost"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, in theory the emulator can listen on all sorts of hosts and ports. Common configurations include 127.0.0.1, localhost, but it can be changed by the user to LAN or even public IP addresses and domains, and I've seen those in the wild. We had a similar discussion re: RTDB emulator and the conclusion so far is not to try and detect emulator URLs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SG. I will just check for firebaseio or firebasedatabase if u think firebase is too general.

Comment thread src/utils.ts Outdated
urlObj.hostname.includes("firebaseio.com") ||
urlObj.hostname.includes("firebasedatabase.app")
) {
if (urlObj.hostname.includes("firebase")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's just list all three full domain names to be on the safe side. myfirebaseapp.example.com should be filtered out.

Comment thread src/utils.ts Outdated
urlObj.hostname.includes("firebaseio.com") ||
urlObj.hostname.includes("firebasedatabase.app")
) {
if (urlObj.hostname.includes("firebase")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

@fredzqm
fredzqm merged commit 1d3e5e9 into master Mar 4, 2021
@fredzqm
fredzqm deleted the fz/rm-fix branch March 4, 2021 20:19
This was referenced Mar 9, 2021
This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants