Model B: DIRECT messages retry until delivered (proof-wait timeout)#94
Merged
Conversation
Picks up the DIRECT small-packet delivery-proof fix: DIRECT messages now keep in pendingOutbound at .sent and retry (link teardown + revert + fresh re-send) until the proof advances them to .delivered or MAX_DELIVERY_ATTEMPTS, matching python __link_packet_timed_out; DIRECT .sent reloads on NE relaunch. Closes the gap left by the opportunistic fix (#93). Verified on device: direct_echo smoke passes — DIRECT send round-trips and the device processes the delivery proof (delivery confirmed); 35 LXMF-swift router/delivery unit tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…#9 5/5) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The feat/lxmfdb-appgroup-sharing branch was deleted on merge; pin the XCRemoteSwiftPackageReference requirement + Package.resolved to main @ 1f2bb31 so a fresh resolve doesn't reference a missing branch ref. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… reaction) PR #11 merged to LXMF-swift main. Device-verified: direct_echo + direct_attachment_echo pass on the merged build (no regression from the Link.setCloseCallback wiring). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The opportunistic delivery-proof fix (#93) left the DIRECT path with the same latent bug: a small-packet DIRECT message was dequeued at
.sentand relied solely on the in-memory proof callback, so a lost link proof — or the NE being suspended/jetsammed during the proof window — stranded it at a single checkmark. DIRECT is Columba's large-message fallback, so this had to be fixed before shipping.Fix (LXMF-swift
72c4496, this PR bumps the pin)Brings DIRECT to python parity (
LXMRouter.py:2596-2673,LXMessage.py:471-484,613-618):processOutbound's.directcase keeps the small-packet message inpendingOutboundat.sentwithnextDeliveryAttempt = now + DELIVERY_RETRY_WAIT(full-record persist). While awaiting the proof it's skipped byshouldAttemptDelivery(no duplicate during the wait — matches python's "waiting for proof"). When the window elapses and it's still.sent, it tears down the link (closeAndRemoveDeliveryLink→Link.close(.timeout)+transport.unregisterLink), reverts.sent→.outbound, and re-sends over a fresh link — mirroring python's__link_packet_timed_outteardown + re-establish. Removed only on.deliveredorMAX_DELIVERY_ATTEMPTS.loadPendingOutboundnow reloads DIRECT.sent(not just opportunistic), so a proof missed during NE jetsam recovers on relaunch. Still excludes PROPAGATED.sent(terminal); DIRECT RESOURCE persists.outboundso it's never double-handled.state != .deliveredin both the DIRECT and opportunistic branches, so a proof landing during the sendawaitisn't clobbered back to.sent.Design: pure LXMF-swift, no reticulum-swift change. reticulum-swift has no
set_timeout_callbackprimitive and RNS never retransmits link DATA — so python's DIRECT re-send is itself poll-driven byprocess_outbound; the swift poll is faithful, and a transport callback wouldn't survive NE suspension anyway. Two intentional divergences (no timeout-callback primitive; rtt*6 collapsed intoDELIVERY_RETRY_WAIT) documented inport-deviations.md. Stricter-parity follow-ups (rtt-based fast dead-link detection,Link.setCloseCallbackearly-close) tracked on LXMF-swift issue #10.Verification
testLoadPendingOutboundReloadScopingpins the reload filter —.outbound+ OPPORTUNISTIC/DIRECT.sentreload, PROPAGATED.sentdoes not. All 35 router/delivery tests pass.direct_echosmoke scenario passes — device sends DIRECT → Mac echo bot round-trips → device processes the delivery proof (delivery confirmed) and reaches.deliveredwithin the proof-wait window (no spurious retry); NE boots clean, no crash.🤖 Generated with Claude Code