The bug. A message with two Message-ID headers is keyed by both in the archive, while a JMAP server's messageId reflects one. Export never paired the two, so every rerun imported the message again. Shown live on inbuxa 27.1-rc.4: on main, the second export reports Email: created=1.
The fix. It's in src/sync/export/email.rs. While some target emails are still unpaired, each batch about to be imported is first parsed by the target (Email/parse, on blobs that were being uploaded anyway). A message the target already holds under the key it computes is then matched to that email, preferring an equal size. It gets the usual keyword and folder patch, so it stays in sync on later runs too.
When every target email is already paired (e.g. a first export into an empty account), no Email/parse call is made.
If the target refuses Email/parse, it isn't asked again that run; any other failure leaves only that batch unchecked. Either way the messages are imported as before.
The parsed key also settles a batch whose import ended without a clear answer, so a message that did arrive isn't sent twice.
Upstream fixed the same case in v1.0.17. This PR is written on our own code and tests, not ported from upstream.
Tests
tests/mock_sync.rs, 4 new tests (all failed on main): matched and not imported, matched and keywords synced, target can't parse so imported, parsed as a different message so imported.
tests/integration_inbuxa.rs: a_message_with_two_message_ids_is_not_exported_twice. It fails on main and passes here; all 5 live inbuxa tests pass.
cargo test --locked: 1731 passed, 0 failed, 71 ignored. cargo fmt --check and cargo clippy --all-targets are clean.
Refs #86.
**The bug.** A message with two `Message-ID` headers is keyed by both in the archive, while a JMAP server's `messageId` reflects one. Export never paired the two, so every rerun imported the message again. Shown live on inbuxa 27.1-rc.4: on main, the second export reports `Email: created=1`.
**The fix.** It's in `src/sync/export/email.rs`. While some target emails are still unpaired, each batch about to be imported is first parsed by the target (`Email/parse`, on blobs that were being uploaded anyway). A message the target already holds under the key it computes is then matched to that email, preferring an equal size. It gets the usual keyword and folder patch, so it stays in sync on later runs too.
- When every target email is already paired (e.g. a first export into an empty account), no `Email/parse` call is made.
- If the target refuses `Email/parse`, it isn't asked again that run; any other failure leaves only that batch unchecked. Either way the messages are imported as before.
- The parsed key also settles a batch whose import ended without a clear answer, so a message that did arrive isn't sent twice.
Upstream fixed the same case in v1.0.17. This PR is written on our own code and tests, not ported from upstream.
**Tests**
- `tests/mock_sync.rs`, 4 new tests (all failed on main): matched and not imported, matched and keywords synced, target can't parse so imported, parsed as a different message so imported.
- `tests/integration_inbuxa.rs`: `a_message_with_two_message_ids_is_not_exported_twice`. It fails on main and passes here; all 5 live inbuxa tests pass.
- `cargo test --locked`: 1731 passed, 0 failed, 71 ignored. `cargo fmt --check` and `cargo clippy --all-targets` are clean.
A message with two Message-ID headers is keyed by both in the archive,
while a JMAP server's messageId reflects one, so export never paired it
and imported it again on every run (shown live on inbuxa 27.1-rc.4).
While target emails are left unpaired, a batch about to be imported is
parsed by the target first (Email/parse) and each message it already
holds under that key is matched, with its keywords and folders synced
like any other match. A target that refuses Email/parse is not asked
again; any other failure leaves that batch unchecked, imported as before.
The parsed key also settles an import that ended without a clear answer.
Upstream fixed the same case in v1.0.17 (#86); written here on our own
code and tests.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Refs #86.
The bug. A message with two
Message-IDheaders is keyed by both in the archive, while a JMAP server'smessageIdreflects one. Export never paired the two, so every rerun imported the message again. Shown live on inbuxa 27.1-rc.4: on main, the second export reportsEmail: created=1.The fix. It's in
src/sync/export/email.rs. While some target emails are still unpaired, each batch about to be imported is first parsed by the target (Email/parse, on blobs that were being uploaded anyway). A message the target already holds under the key it computes is then matched to that email, preferring an equal size. It gets the usual keyword and folder patch, so it stays in sync on later runs too.Email/parsecall is made.Email/parse, it isn't asked again that run; any other failure leaves only that batch unchecked. Either way the messages are imported as before.Upstream fixed the same case in v1.0.17. This PR is written on our own code and tests, not ported from upstream.
Tests
tests/mock_sync.rs, 4 new tests (all failed on main): matched and not imported, matched and keywords synced, target can't parse so imported, parsed as a different message so imported.tests/integration_inbuxa.rs:a_message_with_two_message_ids_is_not_exported_twice. It fails on main and passes here; all 5 live inbuxa tests pass.cargo test --locked: 1731 passed, 0 failed, 71 ignored.cargo fmt --checkandcargo clippy --all-targetsare clean.