Mail: queued read-state skips shared account validation #1294

Open
opened 2026-10-07 01:16:34 +00:00 by kayg · 1 comment
Owner

Steps:

  1. Run cargo test -p calternal-server integrations::tests::independent_review::migrated_mail_read_state_reaches_endpoint_validation.
  2. The fixture migrates Mail credentials to the shared Connected Account, corrupts only the legacy copy, and sets the IMAP host to empty.
  3. POST a read-state change for the seeded message.

Expected: the route resolves the shared credential, rejects the malformed IMAP host with 400, and does not contact the provider.
Actual: the new durable queue path returns 204 without validating the shared credential or local endpoint syntax. The full server test also reports later_mail_merges_with_existing_shared_calendar with the same 204-versus-400 mismatch.
Evidence: post-merge cargo test -p calternal-server output; failures at crates/calternal-server/src/integrations_review.rs:756 and :1009.
Severity: minor; malformed account settings can queue work that the provider worker cannot deliver.

Steps: 1. Run `cargo test -p calternal-server integrations::tests::independent_review::migrated_mail_read_state_reaches_endpoint_validation`. 2. The fixture migrates Mail credentials to the shared Connected Account, corrupts only the legacy copy, and sets the IMAP host to empty. 3. POST a read-state change for the seeded message. Expected: the route resolves the shared credential, rejects the malformed IMAP host with 400, and does not contact the provider. Actual: the new durable queue path returns 204 without validating the shared credential or local endpoint syntax. The full server test also reports `later_mail_merges_with_existing_shared_calendar` with the same 204-versus-400 mismatch. Evidence: post-merge `cargo test -p calternal-server` output; failures at `crates/calternal-server/src/integrations_review.rs:756` and `:1009`. Severity: minor; malformed account settings can queue work that the provider worker cannot deliver.
Author
Owner

Fixed on ade3457c5.

The read-state route now decrypts the linked Connected Account credential and validates the local IMAP host and port before accepting a change. It does not connect to IMAP. The proxy journal resolves and allocates UIDs only for the selected Message's live copies or pending transfers; a regression seeds 1,000 unrelated Messages and verifies they stay unmapped.

Evidence: cargo test -p calternal-plugin-mail read_state_is_journaled_without_provider_access -- --nocapture passed; cargo test -p calternal-plugin-mail offline_move_is_durable_readable_and_blocks_conflicting_writes -- --nocapture passed. The two server integration regressions are compiling now and will be reported on #1218.

Fixed on `ade3457c5`. The read-state route now decrypts the linked Connected Account credential and validates the local IMAP host and port before accepting a change. It does not connect to IMAP. The proxy journal resolves and allocates UIDs only for the selected Message's live copies or pending transfers; a regression seeds 1,000 unrelated Messages and verifies they stay unmapped. Evidence: `cargo test -p calternal-plugin-mail read_state_is_journaled_without_provider_access -- --nocapture` passed; `cargo test -p calternal-plugin-mail offline_move_is_durable_readable_and_blocks_conflicting_writes -- --nocapture` passed. The two server integration regressions are compiling now and will be reported on #1218.
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal-v0#1294
No description provided.