Tester feedback: routing, bulk select, notifications, map crash

Routing
- Auto routing picks routes by Thompson sampling over faded delivery
  stats (24 h half-life, capped evidence), weighted by what the radio
  currently hears; retries prefer a different route; last attempt floods.
- Route failures are held until a message's fate is known, so an offline
  contact no longer wrecks its route history; failing routes are only
  deleted after a week without a delivery.
- Direct (zero-hop) path is a rotation candidate (#643) and a new Direct
  mode in the routing sheet; history routes are used for repeater logins.
- Remove the route-weight sliders the new chooser no longer uses.

Chats
- Bulk selection in channel chats (spam / not spam / delete / copy) and
  in the Filtered messages list.
- Tapping a search result jumps to the message.
- Swipe-to-reply ignores vertical scrolls.
- Active conversation follows route lifecycle, so covered chats count
  unread again.

Notifications
- Tapping a notification opens its conversation.
- Per-conversation coalescing and one alert per queued-message sync.
- Monochrome status-bar icon; background service stops when the app is
  swiped away; stale notifications cleared on radio or slot change.

Other
- Online map: opaque links and painted dots for dense areas to avoid an
  Impeller GPU crash; expandable hop list on path maps.
- Contact share: clipboard import of shared contacts, "Add again".
- Android: enableEdgeToEdge and scrolling-screenshot support.
- Translations for all new strings; fix mistranslated routing labels.
This commit is contained in:
zjs81 committed 2026-11-08 23:19:15 -07:00
1 parent f81f2686a7
commit 5ea44d6ce9
85 files changed
+6520 -1716

No files matched your search

+44 -14
View File
@@ -95,6 +95,14 @@ class MessageRetryService extends ChangeNotifier {
final Map<String, Message> _pendingMessages = {};
final Map<String, Contact> _pendingContacts = {};
final Map<String, List<PathSelection>> _attemptPathHistory = {};
/// Route failures of each pending message, held back until its fate is
/// known: if any attempt is acknowledged the contact was reachable and the
/// routes that timed out really failed; if nothing ever gets through the
/// contact was probably just offline, and blaming its routes would wreck a
/// good history.
final Map<String, List<({int attempt, PathSelection selection})>>
_deferredRouteFailures = {};
final Map<String, List<AckHashMapping>> _ackHashToMessageId = {};
final Map<String, List<int>> _expectedAckHashes = {};
final List<_AckHistoryEntry> _ackHistory = [];
@@ -618,6 +626,7 @@ class MessageRetryService extends ChangeNotifier {
_pendingMessages.remove(messageId);
_pendingContacts.remove(messageId);
_attemptPathHistory.remove(messageId);
_deferredRouteFailures.remove(messageId);
_timeoutTimers.remove(messageId);
_resolvedMessages.remove(messageId);
// Cancellation (and other cleanup paths) must release the active in-flight
@@ -653,13 +662,10 @@ class MessageRetryService extends ChangeNotifier {
final backoffMs = 1000 * (1 << message.retryCount);
if (selection != null) {
_recordPathResultFromMessage(
contact.publicKeyHex,
message,
selection,
false,
null,
);
_deferredRouteFailures.putIfAbsent(messageId, () => []).add((
attempt: message.retryCount,
selection: selection,
));
}
final updatedMessage = message.copyWith(
@@ -690,13 +696,19 @@ class MessageRetryService extends ChangeNotifier {
config!.clearContactPath!(contact);
}
_recordPathResultFromMessage(
contact.publicKeyHex,
message,
selection,
false,
null,
);
// Nothing got through on any route: treat the contact as unreachable
// and leave its routes' records alone. Only flood stats count the miss.
// The held failures stay until the grace-period cleanup below, so a
// late ACK still blames the routes that really failed.
if (selection != null && selection.useFlood) {
_recordPathResultFromMessage(
contact.publicKeyHex,
message,
selection,
false,
null,
);
}
config?.updateMessage(failedMessage);
@@ -828,12 +840,29 @@ class MessageRetryService extends ChangeNotifier {
);
final wasAlreadyResolved = _resolvedMessages.contains(matchedMessageId);
final deferredFailures =
_deferredRouteFailures.remove(matchedMessageId) ?? const [];
_cleanupMessage(matchedMessageId);
config?.updateMessage(deliveredMessage);
if (contact != null) {
// The contact was reachable, so earlier attempts that timed out
// really failed — except the attempt this (possibly late) ACK is for.
// Without knowing which attempt was acknowledged, blame nothing.
if (!ambiguousPath && matchedAttemptIndex != null) {
for (final failure in deferredFailures) {
if (failure.attempt == ackedAttempt) continue;
_recordPathResultFromMessage(
contact.publicKeyHex,
message,
failure.selection,
false,
null,
);
}
}
if (!ambiguousPath) {
_recordPathResultFromMessage(
contact.publicKeyHex,
@@ -948,6 +977,7 @@ class MessageRetryService extends ChangeNotifier {
_pendingMessages.clear();
_pendingContacts.clear();
_attemptPathHistory.clear();
_deferredRouteFailures.clear();
_expectedAckHashes.clear();
_ackHistory.clear();
_ackHashToMessageId.clear();