Skip to content

Heuristic email parser stores wrong segment time on table-layout confirmations (real Enterprise example) #9

Description

@samsclub91

Upstream parseTravelEmailLocal() misses pickup/return dates in real-world table layouts and falls back to the first date-like string in the text — which in a forwarded email is the forward header/quote line, not the reservation.

Repro (genuine Enterprise Rent-A-Car confirmation, forwarded through Gmail):

Reservation Details

Pickup Date & Time

Sat, Oct 3 2026 9:00 AM

Return Date & Time

Mon, Oct 12 2026 9:00 AM

The date/time live in separate table cells with no label on the same line. pickupOrReturnDate() (label window: 40 chars / same line) matches nothing; firstDate() then grabs the first date-like string in the email, which for a forwarded message is the Date: line of the forward header (e.g. "Thu, Sep 24, 2026 at 3:29 PM") — stored as the segment's startAt.

  • Expected: pickup Oct 3 2026 9:00 AM
  • Stored: Sep 24 2026 15:29 local

Fix direction: either widen the label window to handle multi-line/table-cell layouts (label → next non-empty line(s)), or parse <table> rows directly (label-cell → value-cell). Since the AI tier is the intended path for real confirmations, it may also be reasonable to document the heuristic as a fallback-only path for small/simple emails.

Happy to send a PR with the table-row parsing approach if you want it.

Environment: Roamarr 0.41.7, self-hosted Docker (source build), personal inbox poller, glm-5.3-flash on Ollama Cloud as the AI parser.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions