fix(feedback): stop send-logs hanging forever in sending state - #5364
Conversation
|
👋 thanks for the pr! i couldn't find a before/after screen recording in the description. prs without a video showing the change in action are hard to review and may be closed soon as potential ai slop. to clear this:
if a video genuinely doesn't apply (docs / ci / pure refactor), reply here and a maintainer can remove the label. |
|
@louis030195 Can I get a review on this one ? |
|
Code review: not ready to merge yet.
|
|
@louis030195 Addressed both comments, Can I get a review on this one ? |
Description:
Fixes #5360
Before: clicking "send logs & feedback" could freeze the dialog on
SENDING…forever — button disabled, no error, no retry. None of the calls insendLogshad a timeout, so one stalled connection (or one hung Tauri command) left the promise pending permanently and thecatchthat resets the UI never ran. On top of that, the exact scenario users report from ("recording needs help" → recorder spamming errors into the log) balloons the log file to hundreds of MB, andreadTextFilepulled the entire file across IPC just to keep the last 100 KB — freezing the dialog even on a perfect network.After: every network/IPC step has a deadline; when one is exceeded the existing error path runs — the button returns to idle with a clear "timed out — check your connection and try again" toast, and the user can retry. Log files are tail-read in Rust (seek to end, read only the last 100 KB), so a runaway log can no longer freeze the report flow. What support receives is unchanged — the report always contained only the last 100 KB per log file.
share-logs-button.tsx: addfetchWithTimeout(AbortController) andwithTimeout(promise race); apply to the signed-URL request (30s), redaction (60s — Rust self-bounds at 45s), log/screenshot PUTs (60s), video upload (5 min), and confirm (30s); addxhr.timeout/ontimeouttoputWithProgress; checksignedRes.okbefore parsing so a server error surfaces as a readable messagemedia_commands.rs:upload_file_to_s3used a reqwest client with no timeout, so a stalled PUT hung attempt 1 forever and the 3-retry loop never advanced — now 10s connect / 90s per attempt (3 × 90s + backoff fits inside the webview's 5-min deadline, so all retries get to run)log_files.rs: newread_log_tailcommand — seek tolen - max_bytesand read only the tail, same truncation banner as before;sendLogsuses it instead ofreadTextFile+ sliceread_tailreturns small files whole, truncates large files to exactly the tail with banner, errors on missing files (8/8 pass); vitest — regression test that a hung request recovers to idle with a timeout toast after 30s instead of sticking onSENDING…, logs are read viareadLogTail, andwithTimeoutunit tests (22/22 pass)