fix(nc): fix iOS spinner on text editor — server delay + pushState fallback#174
Merged
fix(nc): fix iOS spinner on text editor — server delay + pushState fallback#174
Conversation
…llback NCViewerNextcloudText starts NCActivityIndicator in viewDidAppear (~350 ms after navigation begins) and stops it in webView:didFinishNavigation:. Our page loaded in <50 ms so didFinish fired before viewDidAppear — stop() was a no-op and the spinner hung permanently. Primary fix: delay GET /text-editor by 700 ms so didFinish is guaranteed to fire after viewDidAppear on any normally-loading device. Belt-and-suspenders: add history.pushState fallbacks at +1200 ms and +2200 ms after page load for very slow/loaded devices where viewDidAppear fires after the 700 ms window. pushState triggers webView:didFinishNavigation: on modern WKWebView more reliably than hash assignment (which was the old broken approach). Also removes the old window.location.hash hack which no longer fires webView:didFinishNavigation: on current iOS/WKWebView. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #173 with an additional
pushStatefallback for robustness.Root cause:
NCViewerNextcloudTextstartsNCActivityIndicatorinviewDidAppear(~350 ms after navigation) and stops it inwebView:didFinishNavigation:. Our page loaded in <50 ms —didFinishfired beforeviewDidAppear, sostop()was always a no-op. Spinner hung permanently.Primary fix: delay
GET /text-editorresponse by 700 ms. On any normal device (push animation ~350 ms),didFinishnow fires well afterviewDidAppearhas started the spinner.Fallback:
history.pushStatecalls at +1200 ms and +2200 ms after page load cover very slow/loaded devices whereviewDidAppearfires after the 700 ms window.pushStatetriggerswebView:didFinishNavigation:on modern WKWebView more reliably than hash assignment.Removes the old
window.location.hashhack which no longer fireswebView:didFinishNavigation:on current iOS/WKWebView.Test plan