Skip to content

fix(frontend): refresh task list after sync#97

Open
prodriguezxyz wants to merge 1 commit intoDCsunset:masterfrom
prodriguezxyz:fix/sync-refresh
Open

fix(frontend): refresh task list after sync#97
prodriguezxyz wants to merge 1 commit intoDCsunset:masterfrom
prodriguezxyz:fix/sync-refresh

Conversation

@prodriguezxyz
Copy link
Copy Markdown

Summary

syncTasks in the Vuex store posts to /api/sync but does not refetch the task list afterwards, so the in-memory state stays stale until the user reloads the page. Any change pulled in by task sync (added, modified, or deleted tasks from another device) is invisible in the UI until F5.

This PR aligns syncTasks with the existing pattern used by deleteTasks and updateTasks — dispatch fetchTasks once the write completes.

Change

-async syncTasks(_context) {
+async syncTasks(context) {
     await this.\$axios.\$post('/api/sync');
+    await context.dispatch('fetchTasks');
 }

Test plan

  • Trigger a sync from the sync icon in the toolbar — tasks refresh without a manual reload.
  • Add/modify/delete a task on another device, run sync from the UI — the change appears immediately.
  • Behaviour of deleteTasks / updateTasks unchanged (they already did this).

🤖 Generated with Claude Code

The syncTasks action posted to /api/sync but never refetched, so the
Vuex state went stale until a manual page reload. Align with
deleteTasks/updateTasks by dispatching fetchTasks on completion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant