Fix timeout observations, drop the last-rx feature and evict weak paths

- Record delivery observations with the path of the attempt the ACK
  belongs to, and skip ambiguous ACKs, so a late direct ACK is not
  learned as a flood delivery.
- Remove secondsSinceLastRx from the timeout model: it measured time
  since any companion frame, which was near zero at train and predict.
- When a contact's path history is full, evict the lowest-scoring path
  instead of silently dropping new discoveries.
This commit is contained in:
zjs81 committed 2026-10-25 11:36:13 -07:00
1 parent 6bc6143c4e
commit 82dcab1d92
8 files changed
+70 -31

No files matched your search

+5 -2
View File
@@ -843,9 +843,12 @@ class MessageRetryService extends ChangeNotifier {
tripTimeMs,
);
}
// Learn from the attempt this ACK belongs to, not the latest one: a
// late ACK for a direct attempt can land after a retry went flood.
if (config?.onDeliveryObserved != null &&
tripTimeMs > 0 &&
message.pathLength != null) {
selection != null &&
!ambiguousPath) {
final outboundTextForObserved =
config!.prepareContactOutboundText?.call(contact, message.text) ??
message.text;
@@ -854,7 +857,7 @@ class MessageRetryService extends ChangeNotifier {
.length;
config.onDeliveryObserved!(
contact.publicKeyHex,
message.pathLength!,
selection.useFlood ? -1 : selection.hopCount,
messageBytesForObserved,
tripTimeMs,
);