Skip to content

fix(cleanup): address round 2 of CodeRabbit review findings#14

Merged
notedwin-dev merged 2 commits into
stagingfrom
bugfix/pr10-coderabbit-cleanup
Jun 5, 2026
Merged

fix(cleanup): address round 2 of CodeRabbit review findings#14
notedwin-dev merged 2 commits into
stagingfrom
bugfix/pr10-coderabbit-cleanup

Conversation

@notedwin-dev
Copy link
Copy Markdown
Owner

Round 2 of CodeRabbit cleanup on top of the merged PR #13 (which fixed the round 1 findings).

Deletion guard + sanitization

  • src/lib/application/commands/accounts.ts deleteAccount: guard now also matches t.toAccountId === accountId so transfers TO the account block deletion too
  • components/AccountForm.tsx sanitizeNote: pattern changed from a 14–20 char window (\d[ -]?(?:\d[ -]?){12,18}\d) to /[\d -]+/g so the entire digit/separator run is matched, not just a substring of a longer run; the callback's digits.length 13–19 check then decides redaction. This also supersedes the auto-fix commit 5e2edc9 which only adjusted the window from 14–20 → 13–19

Persistence failure recovery

  • src/lib/application/commands/accounts.ts saveAccount: persist wrapped in try/catch; if saveTransactions fails, restore existingAccounts and rethrow so the in-memory state matches the failed persist. Order is saveTransactionssaveAccounts (the user's finding 1a + this round 4) — the auto-fix commit 5e2edc9 had the wrong order (saveAccounts first, then saveTransactions) which has been corrected

Partner-leg propagation

  • src/lib/application/commands/transactions.ts: hoisted sharedTransferFields to function scope and extended the partner-leg guard to also fire when any shared field appears in nullifiedFields or Object.keys(cleanUpdates); ensures note/shopName/etc. edits on a transfer propagate to the linked leg

ADR structure

  • docs/adrs/002-drop-vault-data-minimization.md: Considered Options moved under Context (### subsection), Migration shape and References moved under Consequences (### subsections); top-level order is now Context → Decision → Consequences → Status with Status at end

Validated: npx tsc --noEmit clean, npm test 14 files / 153 tests pass

Commits since PR #13 merge: 5e2edc9 (CodeRabbit auto-fix, partially overridden) + 3bef861 (this round, rebased on top of 5e2edc9)
Diff vs staging: 4 files changed, 23 insertions(+), 18 deletions(-)

Deletion guard + sanitization:
- accounts.ts deleteAccount: guard now also matches t.toAccountId ===
  accountId so transfers to the account block deletion too
- AccountForm.tsx sanitizeNote: pattern changed from a 14-20 char
  window (\d[ -]?(?:\d[ -]?){12,18}\d) to /[\d -]+/g so the entire
  digit/separator run is matched, not just a substring of a longer
  run; the callback's digits.length 13-19 check then decides
  redaction

Persistence failure recovery:
- accounts.ts saveAccount: persist wrapped in try/catch; if
  saveTransactions fails, restore existingAccounts and rethrow so
  the in-memory state matches the failed persist

Partner-leg propagation:
- transactions.ts: hoist sharedTransferFields to function scope and
  extend the partner-leg guard to also fire when any shared field
  appears in nullifiedFields or Object.keys(cleanUpdates); ensures
  note/shopName/etc. edits on a transfer propagate to the linked leg

ADR structure:
- 002-drop-vault-data-minimization.md: Considered Options moved
  under Context (### subsection), Migration shape and References
  moved under Consequences (### subsections); top-level order is
  now Context → Decision → Consequences → Status with Status at end

Validated: npx tsc --noEmit clean, npm test 14 files / 153 tests pass
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
finance-tracker-app Ready Ready Preview, Comment Jun 5, 2026 8:31pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4c2e65d6-2da0-45ae-8a53-162bac826607

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/pr10-coderabbit-cleanup

Comment @coderabbitai help to get the list of available commands and usage tips.

@notedwin-dev notedwin-dev merged commit cc49a9e into staging Jun 5, 2026
3 checks passed
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