Prevent Sales Order Agent from skipping emails moved into monitored folders - #11063
Conversation
Good Sense Reviewer - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis change stops advancing the Sales Order Agent email retrieval lower bound after each folder poll. That lets a message still be found if it was received earlier but moved into the monitored folder after a previous empty poll. Processed messages are still excluded by the existing Outlook category filter, so the change relies on that category as the duplicate guard. Problem-solution fitFit: Strong The reported problem is a race between folder moves and a received-time polling watermark. Removing the runtime watermark update directly addresses that race, and the surrounding retrieval still filters by folder and excludes messages already marked as processed. SuggestionsS1 (🟠 Moderate): Add folder polling regression coverage Risk assessment and necessityRisk: The regression surface is folder-based email polling in Sales Order Agent. The main risk is repeated scanning from the configured lower bound, but the folder filter, max-email limit, and processed category still bound normal processing and duplicate handling. Necessity: The change is needed because moved messages keep their original received time. Without this change, a successful empty poll can permanently exclude an eligible message from later retrieval.
|
Predrag Maricic (PredragMaricic)
left a comment
There was a problem hiding this comment.
The change correctly preserves the configured Start Date as the retrieval lower bound, preventing emails moved into a monitored folder after receipt from being permanently excluded. Processed messages remain excluded server-side by category, and the change is narrowly scoped.
What & why
Stop advancing Earliest Sync At after email polling. Moved emails retain their original received timestamp, so advancing this value could permanently exclude them from later retrieval.
The configured Start Date remains the retrieval lower bound, while Graph excludes emails already categorized as processed. Added regression tests for empty and under-full polling.
Linked work
Fixes AB#648911
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility
Low risk. No schema, API, setup, or connector changes. Existing Start Date behavior during setup, reactivation, and mailbox changes remains unchanged. Previously processed emails continue to be excluded server-side by their Outlook category.