[tasks] fix task pagination race in project view#39
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis change adds a shared latest-request guard and applies it to frontend search, dashboard, administration, project, and task loading flows. Project-task loading distinguishes initial and subsequent loading states, while pagination relies on reactive offset changes. ChangesLatest-request loading and search flows
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Pull request artifacts
|
|
Это в целом очень популярный шаблон. Нет ли возможности его абстрагировать или может есть готовое решение? |
9eedd0e to
752c1da
Compare
|
Что изменилось? |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/lib/components/AssigneeCombobox.svelte (1)
60-76: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winAdd
loading = falsetoselectandclear.When a search is in-flight and the user selects an item or clears,
requestGuard.invalidate()prevents the pending request'sonFinallyfrom firing, leavingloadingstuck attrue. The empty-query branch indoSearch(line 35) already handles this —selectandclearshould too.🐛 Proposed fix
function select(user: UserBrief) { requestGuard.invalidate(); value = user.id; selectedName = user.name; query = ""; results = []; open = false; + loading = false; } function clear() { requestGuard.invalidate(); value = null; selectedName = ""; query = ""; results = []; open = false; + loading = false; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/lib/components/AssigneeCombobox.svelte` around lines 60 - 76, Set loading = false in both select and clear immediately after requestGuard.invalidate(), so cancelling an in-flight search cannot leave the component stuck in a loading state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/lib/pages/project-tasks.svelte`:
- Around line 98-99: Reset the project state whenever the route slug changes so
stale project data is not rendered during a new project load. Update the
slug-change handling in project-tasks.svelte to clear project (and any
associated error state as appropriate) before fetching the new project,
preserving initialLoading’s existing pagination behavior.
---
Outside diff comments:
In `@frontend/src/lib/components/AssigneeCombobox.svelte`:
- Around line 60-76: Set loading = false in both select and clear immediately
after requestGuard.invalidate(), so cancelling an in-flight search cannot leave
the component stuck in a loading state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be6e4369-c6f0-4b5f-9989-adaff9c25aa7
📒 Files selected for processing (9)
frontend/src/lib/components/AssigneeCombobox.sveltefrontend/src/lib/components/TaskFilters.sveltefrontend/src/lib/latest-request.tsfrontend/src/lib/pages/admin-projects.sveltefrontend/src/lib/pages/admin-users.sveltefrontend/src/lib/pages/dashboard-personal.sveltefrontend/src/lib/pages/dashboard-tasks.sveltefrontend/src/lib/pages/project-tasks.sveltefrontend/src/lib/pages/projects.svelte
Summary by CodeRabbit