Skip to content

fix: resolve critical bugs in receipt processing flow#31

Open
sezallagwal wants to merge 1 commit intoRocketChat:mainfrom
sezallagwal:fix/receipt-processing-bugs
Open

fix: resolve critical bugs in receipt processing flow#31
sezallagwal wants to merge 1 commit intoRocketChat:mainfrom
sezallagwal:fix/receipt-processing-bugs

Conversation

@sezallagwal
Copy link

@sezallagwal sezallagwal commented Jan 21, 2026

Closes #29

Changes

Critical

  • Infinite loop: Added check in ReceiptProcessorApp.ts to skip processing messages from the bot itself.

Logic & Data Integrity

  • Duplicate saves: Removed premature save call in imageHandler.ts; now only saves on user confirmation.
  • Updates creating duplicates: Fixed lookup in receiptRepository.ts to exclude date from associations (date change was causing lookup miss).
  • NaN prices: Added safeParseNumber() in userInterfaceHandler.ts that falls back to original value on invalid input.

UI & Parsing

  • Broken Edit/Delete buttons: Added lazy init for uiHandler in ReceiptProcessorApp.ts.
  • Date parsing: Rewrote date.ts to handle all formats: 28/08/22, 18th Aug, Aug 18, 2022, ISO, etc.

Files changed

  • app/ReceiptProcessorApp.ts
  • app/src/commands/UserCommandHandler.ts
  • app/src/handler/imageHandler.ts
  • app/src/handler/receiptHandler.ts
  • app/src/handler/userInterfaceHandler.ts
  • app/src/prompt_library/client.ts
  • app/src/repository/receiptRepository.ts
  • app/src/utils/date.ts

DEMO

Recording.2026-01-21.074137.mp4

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.

Bug: Fix receipt saving duplicates, broken edit actions, and parsing logic

1 participant