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

fix(analytics,web): sets no-cors on analytics requests for web #8238

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

ristewar
Copy link
Contributor

Description

Requests to Google analytics for web aren't setting no-cors so requests are triggering CORS preflight and subsequently failing.

See the following discussion for more details: #7982 (reply in thread)

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • [x ] Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • [ x] No

Test Plan

Tested manually in Chrome. I verified that no CORS preflight is sent and that I received an HTTP 204 response from my Google analytics request.


Think react-native-firebase is great? Please consider supporting the project with any of the below:

Copy link

vercel bot commented Jan 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2025 8:51pm

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2025

CLA assistant check
All committers have signed the CLA.

@ristewar
Copy link
Contributor Author

@mikehardy

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

Thank you for posting this, and really, thanks for digging in and figuring it out. Much appreciated.

Do you think this line should go as it is redundant now?

https://github.com/invertase/react-native-firebase/pull/8238/files#diff-7a131b11aa8aa31bfcc94e8669e61d36253fe15e2da6b813383f6767ca15f603R318

@mikehardy mikehardy added Workflow: Waiting for User Response Blocked waiting for user response. Workflow: Pending Merge Waiting on CI or similar labels Jan 19, 2025
@ristewar
Copy link
Contributor Author

Yup, done, also retested with that line removed and verified we still get an HTTP 204 from Google Analytics.

@ristewar
Copy link
Contributor Author

Thank you for posting this, and really, thanks for digging in and figuring it out. Much appreciated.

Do you think this line should go as it is redundant now?

https://github.com/invertase/react-native-firebase/pull/8238/files#diff-7a131b11aa8aa31bfcc94e8669e61d36253fe15e2da6b813383f6767ca15f603R318

Done.

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

A thing of beauty - thanks again

@mikehardy mikehardy removed Workflow: Waiting for User Response Blocked waiting for user response. Workflow: Pending Merge Waiting on CI or similar labels Jan 20, 2025
@mikehardy mikehardy merged commit 17e8e49 into invertase:main Jan 20, 2025
16 of 17 checks passed
@mikehardy
Copy link
Collaborator

It's in the publish queue now, should be out on npmjs.com in a minute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants