Skip to content

fix: advance email poll cursor by 1 ms to prevent restart re-push#6

Merged
brandwe merged 1 commit into
microsoft:mainfrom
evanclan:fix/email-cursor-subsecond-precision
May 27, 2026
Merged

fix: advance email poll cursor by 1 ms to prevent restart re-push#6
brandwe merged 1 commit into
microsoft:mainfrom
evanclan:fix/email-cursor-subsecond-precision

Conversation

@evanclan
Copy link
Copy Markdown
Contributor

Summary

  • Adds advance_cursor() to bump the email poll watermark by 1 ms after each batch, so Graph's receivedDateTime gt {cursor} filter does not re-fetch messages at the cursor's exact second after a server restart (per-session dedup is lost on restart).
  • Adds regression tests for cursor advancement and a two-poll scenario that verifies the filter advances past the latest message.
  • Clears ENTRACLAW_BLOB_* env vars in the email poll test fixture to avoid blob backend leakage on machines with cloud memory configured.

Closes the P1 item tracked in TODOS.md ("Email cursor sub-second precision").

Test plan

  • pytest tests/tools/test_email_poll.py -v (22 passed)
  • ruff check src/entraclaw/tools/email_poll.py tests/tools/test_email_poll.py

Made with Cursor

Graph's receivedDateTime gt filter can re-deliver messages at the cursor's
exact second after a server restart when per-session dedup is lost. Bump the
watermark by 1 ms after each poll batch and isolate email poll tests from
blob env leakage.
@brandwe
Copy link
Copy Markdown
Member

brandwe commented May 27, 2026

Thanks! I'll take this as soon as you agree to the cla @evanclan

@brandwe brandwe self-requested a review May 27, 2026 02:52
@brandwe brandwe self-assigned this May 27, 2026
Copy link
Copy Markdown
Member

@brandwe brandwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brandwe brandwe merged commit 18b2c92 into microsoft:main May 27, 2026
1 of 2 checks passed
@evanclan
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

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.

2 participants