Skip to content

Fix tasks not loading when a project is re-added mid-session#241

Merged
oandregal merged 1 commit into
trunkfrom
vibrant-shamir-01ef01
May 21, 2026
Merged

Fix tasks not loading when a project is re-added mid-session#241
oandregal merged 1 commit into
trunkfrom
vibrant-shamir-01ef01

Conversation

@oandregal
Copy link
Copy Markdown
Contributor

Summary

  • Bug: Tasks created in a project were not listed after removing and re-adding the project (without restarting the app). The projectId repair + load logic in TaskManager.hydrate() only ran at startup, so mid-session re-links left the on-disk tasks orphaned in memory.
  • Fix: Extracted the per-project hydration into a public hydrateProject() method and call it from project-create immediately after the new project record is written. This reads tasks.json, patches any stale projectId values to match the new UUID, loads definitions into memory, repairs stale runs, and emits definitions-changed so the UI updates.

Test plan

  • Create a project, add a task to it
  • Remove the project, then re-add the same folder
  • Verify the task appears immediately (no app restart needed)
  • Verify tasks still load correctly on a fresh app startup
  • npm run test:unit passes (534 tests)
  • npm run lint clean

🤖 Generated with Claude Code

hydrate() only runs at startup, so re-linking a folder mid-session
left its tasks orphaned in memory — they only reappeared after an app
restart. Extract hydrateProject() and call it from project-create so
tasks are loaded and projectId-repaired immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 21, 2026 17:17
@oandregal oandregal merged commit 43973ce into trunk May 21, 2026
@oandregal oandregal deleted the vibrant-shamir-01ef01 branch May 21, 2026 17:17
@oandregal oandregal review requested due to automatic review settings May 21, 2026 17:39
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