Restore the periphery ignore the skip-set fix made necessary again

Removing the alias-scoped sweep from flushOutbox took away the only
direct read of PeerMessageKey.peerID, so Periphery flags it assign-only
and the Dead Code check goes red. That sweep is exactly what commit
a450204 cited when it dropped this suppression, and exactly what the
Critical fix in 1adf220 had to delete: it derived the flush's skip set
from every secureTransmissions entry under the aliases with no liveness
check.

The property is not dead. It is what scopes secureTransmissions and
dropMessage per peer, and it is read through the synthesized Hashable
conformance, which the indexer cannot attribute. Deleting it to satisfy
the scanner would let one alias's drop clear its twin under the other —
the bug this PR spent three commits closing.

Verified locally with periphery scan --strict: the MessageRouter warning
is gone and the restored directive is not itself reported superfluous,
which is the failure mode that turned this red the last time round.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ecgang 2026-07-31 10:07:39 -07:00
parent 7ccaac556e
commit 9e95374bca

View File

@ -35,10 +35,19 @@ final class MessageRouter {
typealias QueuedMessage = MessageOutboxStore.QueuedMessage
private struct PeerMessageKey: Hashable {
// Both properties are read directly now `peerID` by the alias-scoped
// sweep in `flushOutbox(forAliases:)`, `messageID` throughout so the
// ignore directive this once carried (for reads visible only through
// the synthesized Hashable conformance) would itself be flagged.
// periphery:ignore - read only via the synthesized Hashable
// conformance (dictionary-key identity), which the indexer
// cannot attribute; see retain_codable_properties in .periphery.yml
// for the same class of false positive.
//
// The alias-scoped sweep in `flushOutbox(forAliases:)` used to read
// this directly, which is why the suppression was dropped in a450204.
// That sweep was the bug: it derived the flush's skip set from every
// `secureTransmissions` entry under the aliases with no liveness
// check, so removing it brought the false positive back. Do not delete
// the property to satisfy the scanner it is what scopes
// `secureTransmissions` and `dropMessage` per peer, and collapsing it
// would let one alias's drop clear its twin under the other.
let peerID: PeerID
let messageID: String
}