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 infinite loop due to objectWillChange firing #4

Merged
merged 3 commits into from
May 15, 2024

Conversation

ichiho-ojima
Copy link
Collaborator

@ichiho-ojima ichiho-ojima commented May 11, 2024

An infinite loop occurs in the following flow:

  1. A web page is loaded.
  2. Upon loading, the @Published var url in WebViewProxy is updated.
  3. objectWillChange of @Environment(\.webViewProxy) is triggered.
  4. _WebView.updateEnhancedWKWebView is called.
  5. applyModifiers is called, returning to step 1.

This issue is resolved by #1 alone, but this PR addresses the underlying cause, which is the handling of WebViewProxy.

@ichiho-ojima ichiho-ojima changed the title Fix infinite loop caused by URL loading【Inspired by #3】 Fix infinite loop due to objectWillChange firing May 15, 2024
@ichiho-ojima ichiho-ojima marked this pull request as ready for review May 15, 2024 00:27
@ichiho-ojima ichiho-ojima requested a review from Kyome22 May 15, 2024 00:27
@Kyome22
Copy link
Collaborator

Kyome22 commented May 15, 2024

Resolved conflict with #1.

Copy link
Collaborator

@Kyome22 Kyome22 left a comment

Choose a reason for hiding this comment

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

LGTM

@Kyome22 Kyome22 merged commit fae50c0 into main May 15, 2024
@Kyome22 Kyome22 deleted the fix-infinite-loop-3 branch May 15, 2024 01:16
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.

None yet

2 participants