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

feat: wrap navigator.locks.request with plain promise to help zone.js #989

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

hf
Copy link
Contributor

@hf hf commented Dec 6, 2024

Wraps the navigator.locks.request() function with a plain Promise as libraries such as zone.js patch this object to track execution context. It appears that this browser API uses a native promise that's not patched, causing the tracking context to be lost.

It is believed that wrapping this non-zone.js Promise returned by the browser with a promise that's patched by zone.js can help the situation.

Related:

Copy link
Contributor

@J0 J0 left a comment

Choose a reason for hiding this comment

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

Thanks! Hopefully wrapping with a promise and adding additional logs will alleviate the issue

@hf hf merged commit 2e6e07c into master Dec 6, 2024
5 checks passed
@hf hf deleted the hf/wrap-navigator-lock-plain-promise branch December 6, 2024 11:08
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