Repository navigation
Conversation
Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Chen Asraf <casraf@pm.me>
Author
|
/backport to stable35 |
This branch has not been deployed
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
The global search can still get stuck sending cancelled
/apps/deck/api/v1.0/searchrequests forever, see #8796 (it took my server down).When a page of results has nothing to show (all of them are on the open board), the search section switches to "No results found" and unmounts the infinite scroll sentinel.
vInfiniteScrollstops its scope on unmount, but the load that just finished still re-arms it from.finally()(vueuse/vueuse#5732), so the dead loader fetches the next page, which remounts a new sentinel with its own loader. From there the two keep cancelling each other's requests, and the cursor never moves.This makes
canLoadMoreonly say yes for the sentinel that is currently mounted, tracked with a function ref. The dead loader'scanLoadthen goesfalseas soon as its sentinel unmounts, so it never fires again. When a page is fully filtered out, loading now stops at "No results found", same as theInfiniteLoadingversion before the Vue 3 migration did.To test (the loop only keeps going when the search endpoint takes more than ~100ms, a dev instance with xdebug is slow enough):
zzloopon board A, make sure nothing else matcheszzloopinto the search fieldsearch?term=zzloop&cursor=<that card's lastModified>, all cancelled, also after clearing the field (term=). After: 2 requests and that's it, clearing sends one moreShould be backported to stable35, 1.19.2 has the bug.
TODO
Checklist
🤖 AI (if applicable)
Claude Code helped track down the cause, wrote the fix and the unit tests, and ran the verification below on a local Nextcloud 36 dev instance. I reviewed and tested it myself as well.
Verification details
Requests counted with an in-page XHR recorder, Chrome 158, Nextcloud 36.0.0 dev, Deck main at 7650cb5.
On main, pasting a term whose only match is on the open board loops at ~19 req/s with the cursor stuck, until the recorder stopped it at 80 requests.
With this PR, on the same instance:
npx jest(56 passed),eslintandstylelinton the changed files are clean.Assisted by ClaudeCode:claude-opus-5-5