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

IOU - Mapbox "Refused to load the script" console errors when Clicking on Submit expense #43221

Closed
1 of 6 tasks
lanitochka17 opened this issue Jun 6, 2024 · 21 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 6, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.80-6
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - internal Team

Issue found when executing PR #42737

Action Performed:

  1. Log in with an expensifail account
  2. Open the Chrome console
  3. Navigate to FAB - Start chat
  4. Enter an existing Gmail account
  5. Click on the "+" button and Submit expense

Expected Result:

There shouldn't be any console errors-

Actual Result:

2 "Refused to load the script" and a "NetworkError: Failed to execute 'importScripts'" console errors appear right when clicking on Submit expense button

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6504331_1717703821734.bandicam_2024-06-06_21-48-11-743.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@johncschuster FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@MonilBhavsar MonilBhavsar self-assigned this Jun 7, 2024
@MonilBhavsar
Copy link
Contributor

Looking as it is coming from #42737

@MonilBhavsar
Copy link
Contributor

This does seem like a network issue where we could not load mapbox library. @lanitochka17 could you please retry, thanks!

@MonilBhavsar MonilBhavsar added Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Jun 7, 2024
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@MonilBhavsar
Copy link
Contributor

I see when using a very new gmail account. Looking...

@MonilBhavsar MonilBhavsar removed Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Jun 7, 2024
@MonilBhavsar
Copy link
Contributor

@neil-marcellini or @hayata-suenaga any one of you know of a recent change that would have caused this.
I see CSP for mapbox was introduced in the PR https://github.com/Expensify/Cloudflare-Workers/pull/82
I don't see nay recent change though

@MonilBhavsar MonilBhavsar changed the title IOU - "Refused to load the script" console errors when Clicking on Submit expense IOU - Mapbox "Refused to load the script" console errors when Clicking on Submit expense Jun 7, 2024
@hayata-suenaga
Copy link
Contributor

It appears to be a CORS error. If I remember correctly, the CORS policy is set in the Salt repository, and this issue might stem from a recent change there.

I haven't been invovled in the distance request development since last summer, so I haven't made any recent changes to the code related to this.

@melvin-bot melvin-bot bot added the Overdue label Jun 10, 2024
@MonilBhavsar
Copy link
Contributor

Thanks Hayata! Will take a look at the recent Salt PR's

@melvin-bot melvin-bot bot removed the Overdue label Jun 10, 2024
@MonilBhavsar
Copy link
Contributor

MonilBhavsar commented Jun 10, 2024

This is the error we're getting -

4dd3b60c-99a7-48df-9185-db955ed683c8:1 Refused to load the script 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js' because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-MGU0MDMxMDdmMD/MDhjMDY3MDNmMDkxMDQwMDllMGIz' 'unsafe-eval' https://polyfill.io https://cdn.plaid.com https://www.woopra.com https://assets.onfido.com https://sdk.onfido.com https://sentry.io https://*.sardine.ai/ https://appleid.cdn-apple.com https://www.googletagmanager.com https://web-sdk.smartlook.com https://edge.fullstory.com https://rs.fullstory.com https://accounts.google.com/gsi/client". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I think error is referring to this block where there is no mapbox domain - https://api.mapbox.com
https://github.com/Expensify/Cloudflare-Workers/blob/d905d45425aa55abf2037da0a426dbe785036c84/new.expensify.com/wrangler.toml#L26-L40

May be we need to add it to the list. I am not completely sure about it though

@MonilBhavsar
Copy link
Contributor

Will take a look at the recent Salt PR's

Couldn't see a recent change there

@MonilBhavsar MonilBhavsar added the Reviewing Has a PR in review label Jun 10, 2024
@MonilBhavsar
Copy link
Contributor

I have submitted a PR that will fix this issue

@MonilBhavsar
Copy link
Contributor

We need to deploy CF change

@johncschuster
Copy link
Contributor

It doesn't look like any external contributors were involved in the linked PR. Were there any contributions I'm unaware of that require payment, @MonilBhavsar?

@MonilBhavsar
Copy link
Contributor

All internal, no payment required here

@MonilBhavsar
Copy link
Contributor

@Beamanator is helping with the deploy 🚀

@Beamanator
Copy link
Contributor

Done! Changes should be on staging. Let me know if / when you want me to deploy them to prod

@MonilBhavsar
Copy link
Contributor

No console error on staging. let's ship it to production

Screenshot 2024-06-12 at 3 06 46 PM

@Beamanator
Copy link
Contributor

Nice, shipping :shipit:

@Beamanator
Copy link
Contributor

Deployed 👍

@MonilBhavsar
Copy link
Contributor

Confirmed on production too. Thank you 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants