A publish failure in the log does not say what kind of publish it was

#571 · closed · 0 comments

View on GitHub ↗

akiomik

Derived while reviewing [#570](https://github.com/akiomik/nostui/pull/570), which fixes the neighbouring case. Pre-existing, and about every publish rather than replies, which is why it is not in that PR. ## What happens The status bar names a failed publish by its `PublishKind`; the log lines for the same event do not: ```rust log::error!("Failed to publish {}: {reason}", pending.message); // resolve_publish log::error!("Publish not sent, {cause}: {}", pending.message); // abandon_publish ``` `pending.message` is the note's text for a note or a reply, and a bech32 event id for a reaction or a repost. So a user reporting `[ERR: Reaction] no relay confirmed (note1abc…)` is matched in the log by `Failed to publish note1abc…: no relay confirmed`, which does not say a reaction was what failed — a repost of the same note produces a line that cannot be told apart from it. These lines are silent about the kind rather than wrong about it, which is what separates them from the blank-draft warn #570 fixes: that one said "note" for a reply, actively naming it as the thing it was not. ## Why it matters where it does Nothing in the UI survives long enough to be the record. The status bar holds one line and the next status overwrites it, so the log is what a bug report is reconstructed from — and reconstructing it means pairing what the user saw with what was written. The kind is the part of the bar's line that the log cannot currently supply. `PendingPublish` already carries the kind at both call sites, so this is about what the lines say rather than about reaching for anything. ## Acceptance - A failed publish logs which kind it was, in the same word the status bar used for it. - A reaction and a repost that fail on the same event produce log lines that differ. Nothing in this repository asserts log output today, so whether this arrives with a test is part of the question rather than a given.

Comments