mirror of
https://github.com/block/buzz.git
synced 2026-11-03 07:51:22 +00:00
Deep-link, thread-ancestor, and search-hit targets fetched by ChannelRouteScreen land in targetMessageEvents as RAW RelayEvents and ChannelScreen's resolvedMessages memo merges them into the rendered list with no decrypt. For a DM the body is NIP-44 v2 ciphertext, so it rendered garbled and, on an id collision, clobbered the decrypted cache copy (the merge keeps the last writer). A new useDecryptedTargetMessageEvents hook is the single choke point downstream of all three target setters (the mount-seed useState initializer is synchronous and cannot decrypt in place), decrypting via makeDmIngestDecryptor before the merge; non-DM targets pass through synchronously to avoid a held-back first paint. Also resets the requestedAncestorIdsRef dedup in useLoadMissingAncestors on selfPubkey change, not just channel change: a cold-start ancestor fetched while identity is undefined was recorded as done, so after identity resolved the effect skipped re-fetching it into the live [...,pubkey] bucket and the ancestor silently went missing from the thread. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>