Skip to content

fix(starred): stop endless item requests in Starred view#3694

Merged
Grotax merged 4 commits intomasterfrom
copilot/fix-starred-view-request-issue
Apr 25, 2026
Merged

fix(starred): stop endless item requests in Starred view#3694
Grotax merged 4 commits intomasterfrom
copilot/fix-starred-view-request-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

fetchKey in Starred.vue returned 'starred' for the main view, but the store writes all state flags under 'starred-' + feedId (i.e. 'starred-0'). VirtualScroll reads reachedEnd and fetching from the mismatched key, both always undefined/false, so updated() → $nextTick(loadMore) fires in an infinite loop with a fixed offset.

Summary

  • Starred.vuefetchKey: always return 'starred-' + this.id instead of a bare 'starred' fallback, aligning it with the store's convention:
    - return this.starredFeedId ? 'starred-' + this.starredFeedId : 'starred'
    + return 'starred-' + this.id
  • Starred.vueoutOfScopeFilter: pass this.fetchKey instead of the hardcoded 'starred' string (was a silent no-op for the main Starred view since lastItemLoaded['starred'] was never written):
    - return outOfScopeFilter(this.$store, items, 'starred')
    + return outOfScopeFilter(this.$store, items, this.fetchKey)
  • Starred.spec.ts: update mock state keys from 'starred''starred-0' to match the corrected convention, and rename it(...) descriptions from fetchingItems.starredfetchingItems[starred-0] to match the actual state keys used.
  • CHANGELOG.md: added entry under Unreleased → Fixed documenting the fix.

Checklist

Copilot AI linked an issue Apr 25, 2026 that may be closed by this pull request
3 tasks
…quests

The fetchKey in Starred.vue returned 'starred' for the main view, but the
store wrote flags under 'starred-0'. This mismatch meant reachedEnd and
fetching were never observed, causing VirtualScroll to fire requests forever.

- Change fetchKey to always return 'starred-' + this.id (e.g. 'starred-0')
- Thread this.fetchKey into outOfScopeFilter instead of hardcoded 'starred'
- Update Starred.spec.ts mock keys from 'starred' to 'starred-0'

Agent-Logs-Url: https://github.com/nextcloud/news/sessions/852f7f2d-7b76-493d-a0c2-e41a19a74caf

Co-authored-by: Grotax <5429298+Grotax@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix endless requests in starred view of news app fix(starred): stop endless item requests in Starred view Apr 25, 2026
Copilot AI requested a review from Grotax April 25, 2026 07:44
@Grotax
Copy link
Copy Markdown
Member

Grotax commented Apr 25, 2026

@copilot you forgot to add a changelog entry...

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 25, 2026

@copilot you forgot to add a changelog entry...

Added in e39328d.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes an infinite “load more” request loop in the Starred route by aligning the component’s fetchKey with the Vuex store’s keyed pagination/loading state for starred items.

Changes:

  • Update Starred.vue to consistently use starred-<id> as the fetchKey (including starred-0 for the main Starred view).
  • Pass the computed fetchKey into outOfScopeFilter so filtering matches the store’s lastItemLoaded keys.
  • Adjust Starred.spec.ts mocked Vuex state to use starred-0 keys and document the fix in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/components/routes/Starred.vue Aligns fetchKey and filtering with store’s starred-<feedId> convention to prevent endless loading.
tests/javascript/unit/components/routes/Starred.spec.ts Updates mocked state keys to match the corrected fetchKey convention.
CHANGELOG.md Adds an Unreleased “Fixed” entry documenting the Starred infinite-request fix.

Comment thread tests/javascript/unit/components/routes/Starred.spec.ts Outdated
@Grotax Grotax marked this pull request as ready for review April 25, 2026 14:49
@Grotax Grotax merged commit 5157798 into master Apr 25, 2026
28 checks passed
@Grotax Grotax deleted the copilot/fix-starred-view-request-issue branch April 25, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starred view fires an endless stream of requests

3 participants