Repository navigation
fix(expenses): recover attempts with string actors - #1115
Conversation
Validate expense attempt actorId as a non-empty string while keeping tenantId numeric, and pass String(user.id) at the ExpenseWorkflow boundary so unresolved attempts from string user IDs can be read, replayed, and cleared. Fixes #1055
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
@greptile review |
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Fixes #1055
Intent
Implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1055 ("Expense attempt recovery rejects string actor IDs"): update
frontend/src/lib/expense-attempt.tssoactorIdis typed and validated as a non-emptystring(while keepingtenantIdnumeric), and passString(user.id)at the boundary infrontend/src/components/expenses/ExpenseWorkflow.tsxso persisted unresolved expense attempts for string user IDs can be read, replayed, and cleared properly. Deliver via theno-mistakespipeline as its own PR (Fixes #1055).What Changed
frontend/src/lib/expense-attempt.tssoactorIdinExpenseAttemptSnapshot,expenseAttemptStorageKey,newExpenseAttempt,readExpenseAttempt, andclearExpenseAttemptis typed and validated as a non-emptystringwhile keepingtenantIdnumeric.user.idtoString(user.id)at the storage boundary infrontend/src/components/expenses/ExpenseWorkflow.tsxwhen reading and creating persisted expense attempts.tests/expense-attempt.test.ts(wired intonpm run test:expenses) and E2E coverage infrontend/e2e/expenses.spec.tsfor string-actor expense attempt persistence, recovery, replay, and cleanup.Risk Assessment
✅ Low: The change is a small, well-bounded fix that updates expense-attempt actorId typing and validation to non-empty string while keeping tenantId numeric, passes String(user.id) at the ExpenseWorkflow boundary, and adds unit and E2E regression tests.
Testing
The Test agent exceeded its invocation budget before live validation completed; no evidence was gathered for this head.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.