Skip to content

Code review Round 3: state sync fixes in undo flows#7

Merged
sohamM97 merged 2 commits intomainfrom
code-review
Feb 16, 2026
Merged

Code review Round 3: state sync fixes in undo flows#7
sohamM97 merged 2 commits intomainfrom
code-review

Conversation

@sohamM97
Copy link
Owner

Summary

  • I-9: markWorkedOn/unmarkWorkedOn now call _refreshCurrentList() instead of notifyListeners(), fixing stale grid after undo on already-started tasks
  • I-10: Today's 5 _workedOnTask re-fetches task snapshot after mutation for consistent UI state
  • I-11: Today's 5 complete undo re-fetches task so navigate button reappears correctly
  • I-12: Today's 5 "Done today" now has undo support (matching All Tasks behavior)
  • M-11: Consolidated triple _refreshCurrentList() into single markWorkedOnAndNavigateBack() batch method
  • Updated CLAUDE.md slash command instructions

Test plan

  • All 291 tests pass (flutter test)
  • Linux build succeeds (flutter build linux)
  • Manual test on Linux via ./dev.sh: mark task "Done today" in Today's 5, verify undo works
  • Manual test: complete task from All Tasks leaf detail, verify Today's 5 shows it struck out
  • Manual test: undo "Done for good" in Today's 5, verify navigate button reappears

🤖 Generated with Claude Code

Soham Marik and others added 2 commits February 16, 2026 19:03
Verified all Round 2 critical fixes (CR-1 through CR-4) are correctly
implemented. Found 4 important issues around stale task state after
"Done today" undo operations and Today's 5 snapshot management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- I-9: markWorkedOn/unmarkWorkedOn now call _refreshCurrentList()
  instead of notifyListeners(), fixing stale grid after undo on
  already-started tasks
- I-10: Today's 5 _workedOnTask re-fetches task snapshot after mutation
- I-11: Today's 5 _completeNormalTask undo re-fetches task so navigate
  button reappears correctly
- I-12: Today's 5 "Done today" now has undo support matching All Tasks
- M-11: Consolidate triple _refreshCurrentList() into single batch
  method markWorkedOnAndNavigateBack()
- Update CLAUDE.md: fix commands can run in any session except the
  corresponding review session

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sohamM97 sohamM97 merged commit e92a038 into main Feb 16, 2026
1 check passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01255cf6a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

action: SnackBarAction(
label: 'Undo',
onPressed: () async {
await provider.unmarkWorkedOn(task.id!);

Choose a reason for hiding this comment

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

P2 Badge Preserve previous worked-on timestamp in undo path

The new "Done today" undo handler calls unmarkWorkedOn without restoreTo, which causes last_worked_at to be set to NULL instead of restoring the task's previous value. This means if a task already had historical lastWorkedAt data (for example from yesterday), doing "Done today" and then Undo silently erases that history and changes later weighting/sorting behavior; the All Tasks flow avoids this by capturing and restoring the prior timestamp.

Useful? React with 👍 / 👎.

sohamM97 pushed a commit that referenced this pull request Feb 16, 2026
Security fixes:
- MED-6: Brain dump dialog: maxLength 25000, per-line truncation to 500 chars
- LOW-4: Pre-import backup (.db.bak) before overwriting existing database
- LOW-9: Gradle warns when key.properties missing (debug signing fallback)
- LOW-10: firstWhere with orElse in deleteTask/completeTask/skipTask
- LOW-12: URL text field maxLength 2048
- LOW-13: normalizeUrl validates host contains a dot (rejects garbage input)

Bug fix (from PR #7 review comment):
- Today's 5 "Done today" undo now passes restoreTo to preserve
  historical lastWorkedAt instead of erasing it to NULL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sohamM97 added a commit that referenced this pull request Feb 16, 2026
Security review Round 2: fixes + PR #7 bug fix
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