Enforce flood threshold in retry and path-prep selection

Ensure MessageRetryService forces flood once the attempt reaches floodFromAttempt even if a selector returns null, and pass SendAttemptPlan.floodFromAttempt from preparePathForContactSend so zero-budget plans keep the saved path.
This commit is contained in:
zjs81 committed 2026-11-20 22:51:35 -07:00
1 parent 27cc332383
commit 723fa18b68
4 files changed
+308 -13

No files matched your search

+12 -7
View File
@@ -5466,16 +5466,21 @@ class MeshCoreConnector extends ChangeNotifier {
Future<PathSelection> preparePathForContactSend(Contact contact) async {
PathSelection? autoSelection;
final autoRotationEnabled =
_appSettingsService?.settings.autoRouteRotationEnabled == true;
if (autoRotationEnabled && contact.pathOverride == null) {
final directRetries =
_appSettingsService?.settings.directRetries ??
SendAttemptPlan.defaultDirectRetries;
final settings = _appSettingsService?.settings;
final plan = SendAttemptPlan(
directRetries:
settings?.directRetries ?? SendAttemptPlan.defaultDirectRetries,
floodRetries:
settings?.floodRetries ?? SendAttemptPlan.defaultFloodRetries,
rotateRoutes:
settings?.autoRouteRotationEnabled == true &&
contact.pathOverride == null,
);
if (plan.rotateRoutes) {
autoSelection = _selectAutoPathForAttempt(
contact.publicKeyHex,
attemptIndex: 0,
directRetries: directRetries,
directRetries: plan.floodFromAttempt ?? (1 << 30),
);
}