Skip to content

fix(usePromiseResult): guard cancelIdleCallback for Safari/WKWebView#10812

Open
huhuanming wants to merge 1 commit intoxfrom
worktree-fix-cancelIdleCallback-safari
Open

fix(usePromiseResult): guard cancelIdleCallback for Safari/WKWebView#10812
huhuanming wants to merge 1 commit intoxfrom
worktree-fix-cancelIdleCallback-safari

Conversation

@huhuanming
Copy link
Contributor

@huhuanming huhuanming commented Mar 21, 2026

Summary

  • Fix ReferenceError: Can't find variable: cancelIdleCallback on iOS WKWebView (Safari)
  • The cleanup function in usePromiseResult referenced cancelIdleCallback unconditionally, but this API doesn't exist in Safari/WKWebView
  • Added platformEnv.isNative guard to the cleanup, mirroring the existing guard on the push side

Test plan

  • Existing usePromiseResult tests pass
  • Verify no crash on iOS Safari/WKWebView when navigating to /perps

Open with Devin

…Native

cancelIdleCallback is not available in Safari/WKWebView. The cleanup
function referenced it unconditionally, causing a ReferenceError even
though idleHandles was only populated on native. Mirror the existing
isNative guard from the push side to the cleanup side.
@revan-zhang
Copy link
Contributor

revan-zhang commented Mar 21, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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