Repository navigation
fix(history): wait for the Files router before tagging its entries - #74
Merged
Merged
Conversation
Since the Files app moved to vue-router 5, goToRoute() lands the navigation asynchronously and resolves once the new history entry exists. The viewer tagged the entry with its offset straight after asking for the push, so it tagged the previous one: closing then found no viewer entries to unwind and back reopened the file. Every history change now waits for the router's navigation, queued behind the ones before it, so the offset goes on the entry the push made and two quick navigations do not read each other's stale offset. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
==========================================
+ Coverage 88.90% 88.94% +0.03%
==========================================
Files 39 39
Lines 2776 2786 +10
Branches 574 576 +2
==========================================
+ Hits 2468 2478 +10
Misses 301 301
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
nextcloud/server#63954 fails "closing resets history so back does not re-open a file" since the Files app moved to vue-router 5 (nextcloud/server#61291).
goToRoute()now lands the navigation asynchronously and resolves once the new entry exists, butpushToHistory()tagged the entry with itsviewerPosright after asking for the push, so it tagged the previous entry. Closing then read an offset of 0, skipped thehistory.go(-offset), and back landed on an entry withopenfile=true.Every history change now waits for the router's navigation, queued behind the ones before it.
goToRoute's type says it may return a promise, which the Files router has always done.A new test has the router create its entry only after a delay, like vue-router 5: it fails on
mainwithexpected undefined to be 1and passes here. The existing history tests wait for the queue. Not run against a real server here, the server PR's e2e will tell.👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.