logos-delivery/logos_delivery
stubbsta af94b3c3cf
Simplify legacy lightpush autosharding path to a direct getShard call
The single-content-topic path went through getShardsFromContentTopics,
iterated the resulting table under the assumption it was 1-entry, and
had a defensive fallthrough (`resolved = false` → bare `return`) for
the empty-table case. That case is unreachable: on success the table
always has exactly one entry, and the fallthrough returned a default-
initialized Result — not behavior worth preserving.

Replace with the same two-step pattern the modern lightpushPublish uses
(NsContentTopic.parse → sharding.getShard) so both handlers share a
shape and the (now-explicit) failure paths surface useful error strings.

Verified against tests/node/test_wakunode_legacy_lightpush.nim (9/9).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-09 10:10:26 +02:00
..