[29.x] Prevent Sales Order Agent from skipping emails moved into monitored folders - #11097
[29.x] Prevent Sales Order Agent from skipping emails moved into monitored folders#11097tomasevicst wants to merge 1 commit into
Conversation
Good Sense Reviewer - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis removes the runtime update that moved The change fits the failing path: the Outlook query still scopes to the configured folder and excludes messages already categorized as processed, while existing task-message checks protect against duplicate task messages. No event surface or BaseApp dependency changed, and there is no Sales/Purchase/Service parallel to align for this Sales Order Agent-specific polling code. Problem-solution fitFit: Strong The bug is a clear watermark race: an eligible message can enter the monitored folder after the poll time, but keep an older received time. Removing the polling-time watermark update directly prevents that permanent exclusion and keeps duplicate protection in the existing category and external-message checks. SuggestionsS1 (🟠 Moderate): Add regression coverage for moved emails Risk assessment and necessityRisk: The regression surface is limited to Sales Order Agent email polling. The main tradeoff is that Graph queries keep using the configured start date, but the processed category, Necessity: The change is required because otherwise polling can report success while eligible emails are never discovered. The scope is small and removes the behavior that caused the skip without changing schema, public APIs, setup flow, or connector contracts.
|
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#649175
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.