fix: INBOX sync misses SMTP-delivered mail due to Stalwart CONDSTORE bug

Stalwart 0.14.x does not increment HIGHESTMODSEQ when new mail arrives
via SMTP delivery, so the incremental sync's CONDSTORE fast-path saw
serverModSeq == storedModSeq and returned early — silently skipping
UID SEARCH and missing any newly received messages.

Fix: remove the early-return fast-path. Incremental sync now always
runs UID SEARCH UID ${lastUid+1}:* to discover new messages. CONDSTORE
is still used for the flag-refresh gate (only runs when modseq changed),
which is its correct, narrower role.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Güttler
2026-04-25 17:55:52 +02:00
co-authored by Claude Sonnet 4.6
parent 317827541e
commit 8a51496181
12 changed files with 237 additions and 78 deletions
+9 -2
View File
@@ -98,6 +98,12 @@ tasks:
cmds:
- stalwart-dev/test.sh
integration-ui:
desc: UI E2E tests on Linux via Xvfb — headless, no emulator needed
deps: [_preflight, _linux-deps-check, _pub-get]
cmds:
- stalwart-dev/integration_ui_test.sh
integration-android:
desc: UI integration tests on a connected Android emulator (Stalwart on host, emulator reaches it via 10.0.2.2)
deps: [_preflight, _android-sdk-check]
@@ -131,11 +137,11 @@ tasks:
desc: Build a release APK (output in build/app/outputs/flutter-apk/)
deps: [_preflight, _android-sdk-check, _pub-get]
cmds:
- ANDROID_HOME=${ANDROID_HOME:-$HOME/Android/Sdk} fvm flutter build apk --release --no-pub
- ANDROID_HOME=${ANDROID_HOME:-$HOME/Android/Sdk} fvm flutter build apk --release --no-pub | grep -Ev "was tree-shaken|Tree-shaking can be disabled"
deploy-android:
desc: Build release APK and upload via scp to $ANDROID_APK_SCP_USER@$ANDROID_APK_SCP_HOST:$ANDROID_APK_SCP_PATH
deps: [build-android]
deps: [integration-android, build-android]
dotenv: [".env"]
cmds:
- scripts/deploy_android.sh
@@ -161,4 +167,5 @@ tasks:
deps: [analyze, test-widget, build-linux, test]
cmds:
- task: integration
- task: integration-ui
- task: coverage