Skip to content

Update react-error-overlay CSP hash#1792

Merged
lukaw3d merged 2 commits intomasterfrom
lw/react-err-csp
Dec 7, 2023
Merged

Update react-error-overlay CSP hash#1792
lukaw3d merged 2 commits intomasterfrom
lw/react-err-csp

Conversation

@lukaw3d
Copy link
Copy Markdown
Contributor

@lukaw3d lukaw3d commented Dec 6, 2023

Broken since 9c7da1a

Note: react-error-overlay only appears during development, and csp-react-error-overlay.spec.ts doesn't test it on CI. Running it locally detects it as broken tho.

@lukaw3d lukaw3d requested a review from buberdds December 6, 2023 01:38
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 6, 2023

Deployed to Cloudflare Pages

Latest commit: e695fea9eb36e9d1eb36bb0bf81c7b42b7840d6b
Status:✅ Deploy successful!
Preview URL: https://7c08acdd.oasis-wallet.pages.dev

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 6, 2023

Codecov Report

Merging #1792 (7547175) into master (f11500c) will decrease coverage by 0.08%.
The diff coverage is n/a.

❗ Current head 7547175 differs from pull request most recent head e695fea. Consider uploading reports for the commit e695fea to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1792      +/-   ##
==========================================
- Coverage   81.44%   81.36%   -0.08%     
==========================================
  Files         191      191              
  Lines        5067     5067              
  Branches      930      930              
==========================================
- Hits         4127     4123       -4     
- Misses        940      944       +4     
Flag Coverage Δ
cypress 45.89% <ø> (ø)
jest 77.23% <ø> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

ws://localhost:2222
`
const reactErrorOverlay = `'sha256-RV6I4HWPb71LvA27WVD3cEz8GsJrHlfcM/2X2Q5gV00='`
const reactErrorOverlay = `'sha256-yt+SNVxRkIi6H6yb7ndFuZM1esMX9esg3UpRHaTsyVk='`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a comment where we can find this ID so everyone is aware of it and also when it changes?

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.

Related: #1609 (comment)

I copy it from chrome console, it's printed on any hot-module-reload when it's broken.

Modified the test so it would now print:

  1) [chromium]  csp-react-error-overlay.spec.ts:5:5  Dev Content-Security-Policy should allow react-error-overlay 

    Error: expect(received).not.toMatchObject(expected)

    Expected: not {"type": "error"}
    Received:     {"args": [], "location": {"columnNumber": 0, "lineNumber": 2769, "url": "http://localhost:3000/index.2b04b272.js"}, "text": "Refused to execute inline script because it violates the following Content Security Policy directive: \"script-src 'self' 'sha256-RV6I4HWPb71LvA27WVD3cEz8GsJrHlfcM/2X2Q5gV00=' 'unsafe-eval' 'report-sample'\". Either the 'unsafe-inline' keyword, a hash ('sha256-yt+SNVxRkIi6H6yb7ndFuZM1esMX9esg3UpRHaTsyVk='), or a nonce ('nonce-...') is required to enable inline execution.
    ", "type": "error"}

       at ../utils/expectNoErrorsInConsole.ts:37

      35 |         text: message.text(),
      36 |         type: message.type(),
    > 37 |       }).not.toMatchObject({
         |              ^
      38 |         type: 'error',
      39 |       })
      40 |     }

it's hard to make a prettier output

@lukaw3d lukaw3d enabled auto-merge December 7, 2023 05:04
@lukaw3d lukaw3d merged commit cbd5468 into master Dec 7, 2023
@lukaw3d lukaw3d deleted the lw/react-err-csp branch December 7, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants