Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isSupported fixes #5506

Merged
merged 8 commits into from
Sep 22, 2021
Merged

isSupported fixes #5506

merged 8 commits into from
Sep 22, 2021

Conversation

jamesdaniels
Copy link
Member

@jamesdaniels jamesdaniels commented Sep 16, 2021

isSupported() had bugs in messaging, performance, and analytics.

  • in messaging, isSupported was not checking for the existence of window or indexedDB before validating that indexedDB is openable
  • in performance and analytics, navigator was not being checked for correctly !navigator should be typeof navigator !== 'undefined since it's a global. This led to runtime failures.
  • further I dry'd up performance and messaging to use the same areCookiesEnabled test

Further, the indexedDb check was not working correctly in AppCheck due to checking for it on self (which isn't available in all environments). I addressed this and dry'd up our typeof indexedDb checks to all use isIndexedDBAvailable().

@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2021

🦋 Changeset detected

Latest commit: b550e8d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@firebase/app-check Patch
@firebase/app-check-compat Patch
@firebase/performance Patch
@firebase/performance-compat Patch
@firebase/messaging Patch
@firebase/analytics Patch
@firebase/messaging-compat Patch
@firebase/analytics-compat Patch
@firebase/util Patch
firebase Patch
@firebase/app-compat Patch
@firebase/app Patch
@firebase/auth-compat Patch
@firebase/auth Patch
@firebase/component Patch
@firebase/database-compat Patch
@firebase/database-types Patch
@firebase/database Patch
@firebase/firestore-compat Patch
@firebase/firestore Patch
@firebase/functions-compat Patch
@firebase/functions Patch
@firebase/installations-compat Patch
@firebase/installations Patch
@firebase/remote-config-compat Patch
@firebase/remote-config Patch
@firebase/storage-compat Patch
@firebase/storage Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 2021

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

Copy link
Contributor

@jposuna jposuna left a comment

Choose a reason for hiding this comment

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

LGTM for performance. Thanks for making this change!

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for being so thorough!

Copy link
Contributor

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

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

Looks like no new doc strings, lmk if I'm wrong about that. Thanks!

@Feiyang1 Feiyang1 self-assigned this Sep 20, 2021
@Feiyang1 Feiyang1 assigned jamesdaniels and unassigned Feiyang1 Sep 20, 2021
@Feiyang1 Feiyang1 merged commit b835b4c into master Sep 22, 2021
@Feiyang1 Feiyang1 deleted the fix_is_supported branch September 22, 2021 20:37
@google-oss-bot google-oss-bot mentioned this pull request Sep 22, 2021
@firebase firebase locked and limited conversation to collaborators Oct 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants