Coverage lane 2 (issue #247) — sync, workers, transport & auth
Test-only change (zero production changes, JaCoCo config untouched). Raises JVM unit-test LINE coverage to ≥95% for the in-scope packages.
Measured LINE coverage (:app:jacocoTestReport)
Package
Before
After
data/sync/**
67.0%
98.6% (437/443)
mail/** (IMAP/SMTP/Graph transport)
74.8%
96.7% (561/580)
auth/** (OAuth)
0.0%
100.0% (89/89)
Combined in-scope: 97.8% (1087/1112 lines).
Instruction/branch coverage stays lower than line coverage for this sync/worker/coroutine code — the suspend state machines and Flow collector continuations contain suspend/resume branches that don't execute under synchronous mocks (a known JaCoCo × coroutines limitation, not untested logic). Per the plan this was not chased by contorting tests, and JaCoCo config is untouched (the ratchet is owned by capstone lane #251).
Transport:ImapConnectionCache reuse + dropped-connection retry/clear-slot/closeAll; ImapClientfetchAttachment/setFlag/deleteMessage/idle + empty-folder / unknown-uid / STARTTLS+XOAUTH2 branches (GreenMail); GraphSender.send transport (2xx / rejection / lost-response / transmit-failure) via a test-only URLStreamHandlerFactory fake — no network, no prod seam.
Auth:OutlookAuthManager — two-resource token exchange, id_token email extraction (+ preferred_username fallback), refresh paths, and every failure branch (AppAuth objects built for real; only Android statics + the token-endpoint call are faked); OAuth result models.
Verification (JDK 21)
assembleDebug · testDebugUnitTest · compileDebugAndroidTestKotlin · lintDebug · ktlintCheck · detekt · jacocoTestReport — all green. JVM-only lane (no androidTest/prod changes), so CI's E2E matrix is authoritative.
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.
Coverage lane 2 (issue #247) — sync, workers, transport & auth
Test-only change (zero production changes, JaCoCo config untouched). Raises JVM unit-test LINE coverage to ≥95% for the in-scope packages.
Measured LINE coverage (
:app:jacocoTestReport)data/sync/**mail/**(IMAP/SMTP/Graph transport)auth/**(OAuth)Combined in-scope: 97.8% (1087/1112 lines).
What's covered (new/extended, additive)
SendWorkeroutbox drain — SMTP + Graph sends, the "may-have-sent" no-retry case, Graph→SMTP fallback, staged/inline attachment pairing;MailConnectionFactorytoken cache/refresh (valid-reuse, expired, unknown-expiry, persist-only-when-changed, password + missing-credential errors);MailSyncer.syncAll(partial-failure semantics);SendScheduler;MailBackfillerpre-existing-row refresh branch.ImapConnectionCachereuse + dropped-connection retry/clear-slot/closeAll;ImapClientfetchAttachment/setFlag/deleteMessage/idle+ empty-folder / unknown-uid / STARTTLS+XOAUTH2 branches (GreenMail);GraphSender.sendtransport (2xx / rejection / lost-response / transmit-failure) via a test-onlyURLStreamHandlerFactoryfake — no network, no prod seam.OutlookAuthManager— two-resource token exchange, id_token email extraction (+preferred_usernamefallback), refresh paths, and every failure branch (AppAuth objects built for real; only Android statics + the token-endpoint call are faked); OAuth result models.Verification (JDK 21)
assembleDebug·testDebugUnitTest·compileDebugAndroidTestKotlin·lintDebug·ktlintCheck·detekt·jacocoTestReport— all green. JVM-only lane (no androidTest/prod changes), so CI's E2E matrix is authoritative.Closes #247
🤖 Generated with Claude Code