Repository navigation
Clear a connection's paste bars when it ends, and let X close any bar - #82
Merged
Merged
Conversation
A paste job runs on its connection's LocalSet. When the connection ends, the task is dropped before it can report an end, so its bar stayed on "Pasting text: 0 B" for good. Bars were keyed by job id alone, which every connection numbers from 1, and X only asked the current worker to cancel that id: after a reconnect it cancelled nothing, or another job. Number every worker, key bars by that number and the job id, and remove a connection's bars when it fails, closes, restarts or its tab closes. X now removes its bar at once and only cancels through the worker that ran the job. A closed bar stays closed until its job reports an end.
[Medium impact] This PR appears safe to merge. SummaryThis PR ties paste progress bars to the connection that owns each job.
No actionable issues were found. Checks were not run during this review.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a connection ends while a paste from the server is in flight, its progress bar stays on screen for good, reading "Pasting text: 0 B", and its X button does nothing. I hit this on a laptop client after closing the lid: a process on the laptop read the desktop's text as the lid closed (the clipboard history watcher or the lock screen, which I have not pinned down), the laptop suspended before any bytes arrived, and the reconnect after resume left both bars behind until gliff was restarted.
Three things combine:
LocalSet. When the worker ends, theLocalSetis dropped with the task still parked, soJobs::finishnever runs and no finalProgressreaches the UI.TransferBarsis one widget per window, keyed by the bare job id. Every connection numbers its jobs from 1, and nothing removed rows when a connection ended, so rows from different connections or tabs share keys.CancelTransfer(id)to whatever worker the session had at click time and left the row for the job's final report to remove. After a reconnect the new worker has no such job, so nothing happens, or it has a different job with that id and cancels it.Every worker now has a number (
App::connections,Session::conn), and bars are keyed by that number and the job id. A connection's bars are removed when it fails, closes or is replaced, and when its tab is closed. X removes its row at once and cancels only through the worker that ran the job. A closed row stays closed until its job reports an end, so a progress report already queued cannot bring it back. The bookkeeping lives in a smallBars<R>without GTK, so it is unit tested without a display. Jobs, the status messages and the protocol are unchanged.Validation:
scripts/check.shpasses.#47 moves the Linux client out of
crates/gliff/src/main.rs. If it lands first, I am happy to move these lines to its new file.Opus 5.5 high, on behalf of TechLuddite.
Implemented with Claude Opus 5.5 at high effort, with the diagnosis and the patch reviewed by GPT-6.1 (Codex) and Grok 4.7, both at high reasoning effort, then re-reviewed on 2026-10-19 by Claude, GPT-6.1 and Grok 4.7 at medium effort.