Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟡 1 finding (0 blocking).
The PR replaces the bare try-again fallbacks with sentences that name the action and carry a short ref, keeps a bounded recent-fallback list for Copy diagnostics, and gives chatd's call fallback its own words. Compatibility holds: no protocol type changes, and is_bare covers every bare sentence chatd still emits, so an older server's bare detail is replaced on the client. One real issue: the new fallback log line carries the raw error display, which the removed doc line on this same function explicitly never logged; a decode-failed frame's serde error can embed payload text and reaches the log under a field name the log redactor does not deny.
Residual risk
- quote_code hashes only the action and the class, and every refusal fallback uses the class "refused", so different codes for the same action share one ref: note_fallback merges their hit counts and several log lines with different causes carry the same ref, so the UI ref does not pin down the real error.
- is_bare is an exact-string list; a future bare fallback sentence added in chatd would be shown to the user as sent until the list here is updated in lockstep.
- The is_gone, is_slow and is_other_version branches still log "action failed" without a ref, so a user who quotes only those sentences gives support nothing to grep for.
| OTHER_ANSWER.to_owned() | ||
| } else { | ||
| "That didn't work. Try again.".to_owned() | ||
| with_ref(op, failure_class(err), &err.to_string(), &format!("Couldn't {}. Try again.", action_phrase(op))) |
There was a problem hiding this comment.
| with_ref(op, failure_class(err), &err.to_string(), &format!("Couldn't {}. Try again.", action_phrase(op))) | |
| with_ref(op, failure_class(err), &format!("{:?}", err.kind()), &format!("Couldn't {}. Try again.", action_phrase(op))) |
A request that fails for no specific reason says what was tried and a short ref. The same ref is in the log with the real error, and Copy diagnostics lists recent refs. A call that comes back without an error says it could not be placed. Closes #765
4f79cbc to
5bd400c
Compare
What changed and why
A failure that used to say only "That didn't work. Try again." now names the action and a short ref, such as "Couldn't send that. Try again. (ref 7F3A)." The log line with that ref has the real error and how many times that fallback has happened. Copy diagnostics lists the recent refs, the action, and the count, and leaves the error text in the log. A network's own reason is still shown as sent. The bare sentence is not. A call answer that is not an error says the call could not be placed.
Tested with
cargo test -p tinyclient --features gui --binsandcargo test -p chatd --lib a_missing_error_names_the_call. The new wording tests pass. One existing test, the second-launch invite pipe, could not take the primary pipe because another process already holds it. It is not part of this change.cargo clippy -p tinyclient --features gui --all-targetsstill stops on a pre-existing empty range in the composer. The files in this change added no new clippy warnings.The proof is
TINYCLIENT_PROVE=error-textin the desktop binary, before the window opens. It fails unless a fallback names the action, carries a ref, and drops the bare sentence. A build from before this change ignores the variable and opens the window, so the driver fails there.New protocol error codes, and the Tiny live socket's own fallback sentence, are unchanged. Those sit in the protocol crate and in adapters.
Type
Platforms
Proof
Scenario: e2e/scenarios/error-text
Lab run: not run. The lab was not started for this pull request.
Compatibility
No protocol change. An older server still works. The sentences are local.
Risk and rollback
A person could see the wrong action name, or a ref that is not in the log. Revert this commit.
Release note
A failure names what was tried and a short ref you can quote.