Skip to content

POP3 bounded sync needs durable UIDL progress instead of fixed tail-window polling #1717

Description

@seonghobae

Current authority — 2026-09-18

This issue remains open, but its original source-state description is stale. Canonical email/POP3 owner #1195 has advanced from the fixed-tail predecessor to exact 630d5461d1eb8b59b392e4170dec66ce1edf034c on #1623. The durable UIDL progress repair is now present in source; remaining blockers are integration/evidence, migration reconciliation, and runtime acceptance rather than an absent implementation.

Verified source repair in #1195

The original problem was real: selecting the highest MAX_POP3_FETCH_MESSAGES message numbers on every poll could still starve older unseen messages, and a persistent RETR -ERR tail could monopolize every later poll.

#1195 now keeps provider UIDL as collection identity, separate from Message-ID/source fingerprint semantics, and persists owner-scoped collection state with:

  • disposition observed | retryable;
  • nullable retry_after;
  • bounded selection that prioritizes never-attempted unseen UIDLs before due retries;
  • successful persistence as the condition for moving a UIDL to observed;
  • standard per-message -ERR/parse failures remaining retryable rather than silently completed;
  • provider network I/O outside long-lived DB transaction/lock scope;
  • no DELE during synchronization.

Source-order RED 5d40f83ff48e7dd9c3bf6deb93995130c5a1470a captured cross-poll starvation and retry-selection behavior. Repair 7406cb63923003df2c3a5d21a0104203f78b90bc extended the existing POP3 observed-UIDL state instead of creating a separate collection owner. Current #1195 exact head is 630d5461... after doctoring/authority follow-up.

Migration ownership boundary

The POP3 persistence change is still branch-local, not merge-authoritative. #1195 currently carries 0018_email_date_provenance → 0019_pop3_observed_uidl, while canonical workspace/database owner #1503 exact 9151c75568c582c8147cfee6757cd00a9b4d60b7 owns 0018_workspace_registry → 0019_email_read_state_repair → 0020_workspace_organization_binding → 0021_workspace_personal_owner_binding; both descend from historical 0017.

These are parallel Alembic heads and must not independently merge. Required order is #1503 protected integration first, then ordinary/non-force adoption by #1195 and rechain/renumber of the email/POP3 revisions behind the then-current protected head. Acceptance requires exactly one Alembic head plus fresh and historical PostgreSQL upgrade evidence.

Evidence boundary

Current exact #1195 630d5461... has zero repository-local pull-request workflow receipts. The latest formal CodeRabbit APPROVED review was submitted at 2026-09-17 05:43 UTC and predates the later durable retry/progress generation, so it is historical rather than qualifying current-head evidence. Do not infer PostgreSQL, security, coverage, restart durability, or warning-clean GREEN from source presence alone.

The issue therefore stays open until all of the following are proven on the integrated canonical lineage:

  • fix: create workspace_entities/workspace_documents registry and provision Workspace rows #1503 migration reconciliation and a single Alembic head;
  • fresh PostgreSQL migration/upgrade acceptance;
  • multi-poll maildrop > cap eventual progress;
  • restart durability and UIDL renumbering/deletion behavior;
  • UIDL-unavailable fallback behavior with explicit correctness/resource trade-off;
  • persistent/repeated negative RETR cases without lower-backlog starvation;
  • duplicate-import accounting remains accurate;
  • exact-current test/security/warning/coverage evidence is GREEN;
  • qualifying post-last-push independent review exists.

Keep this issue open. The source repair is present, but closure requires integrated runtime evidence; no fixed message-number window, synthetic status, no-op wake commit, parallel migration head, or second POP3/dedupe implementation is acceptable.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions