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: change window and document DOM access to self checks for SW context #2900

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krissvaa
Copy link
Contributor

Fixes #2867

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.54%. Comparing base (c1245de) to head (cf3a028).

Files with missing lines Patch % Lines
packages/ts/frontend/src/Connect.ts 50.00% 0 Missing and 1 partial ⚠️
packages/ts/frontend/src/CookieManager.ts 0.00% 0 Missing and 1 partial ⚠️
packages/ts/frontend/src/FluxConnection.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2900      +/-   ##
==========================================
- Coverage   92.65%   92.54%   -0.11%     
==========================================
  Files          83       83              
  Lines        2831     2832       +1     
  Branches      729      732       +3     
==========================================
- Hits         2623     2621       -2     
  Misses        156      156              
- Partials       52       55       +3     
Flag Coverage Δ
unittests 92.54% <40.00%> (-0.11%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Nov 11, 2024

@@ -16,7 +16,7 @@ import {
} from './FluxConnection.js';
import type { VaadinWindow } from './types.js';

const $wnd = window as VaadinWindow;
const $wnd = self as VaadinWindow;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest using globalThis across the code. It's guaranteed to work in any environment

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.

PWA endpoint errors while called from SW
2 participants