Skip to content

Fix the tray items from the review - #891

Merged
SimonCropp merged 1 commit into
mainfrom
fix-tray
Sep 23, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
fix-tray

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

This fixes the "Tray" group from todo.md. The review's repro tests now live in the tray test class for each topic.

Item Fix Tests
A failed bind on 3492 leaves the tray running without its listener PiperServer.TryBind binds synchronously at startup, and a failure is logged and shown in a balloon. Serve runs the loop. Start stays as a bind-then-serve helper for the tests PiperTest.ABindThatFailsSaysWhy
The locked-file kill uses a bare PID LockingProcess keeps the start time Restart Manager reported. Kill compares it with the process it opens, and leaves the process alone if it differs or can't be read FileLockKillerTest.Kill_LeavesAProcessThatIsNoLongerTheOneReported
"Open diff tool" throws from a menu built before a re-run's move The item finds the move again by key when clicked (Tracker.FindMove), and AddMove clears the process it disposes TrackerMoveTest.OpenDiffToolFromAMenuBuiltBeforeTheMoveWasUpdated
A reset before accept shows the "open an issue" box The accept loop catches a bare SocketException ConnectionReset, which is how the accept throws it. The read path's wrapped catch stays as it was. Each connection is handled on Task.Run PiperTest.AClientThatResetsBeforeItIsAcceptedIsNotReportedAsAnError
FileComparer blocks a test's delete during a compare Both files open with ReadWrite | Delete sharing. A pass that reads different counts from the two files is a difference, since widening the sharing alone let a file cut short mid-compare read as equal FileComparerTests.ATestCanDeleteItsReceivedFileWhileTheScanComparesIt, A_file_cut_short_mid_compare_is_not_equal
"Always kill locking processes" is ignored for socket accepts ShouldKill reads LockedFilesHandler.AlwaysKill itself, before the no-prompt branch. The resolver is still never consulted for a wire accept TrackerTrackedFilesTest.AlwaysKillAppliesToAnAcceptArrivingOverTheSocket

The full solution passes locally in Release: 2,087 passed, 22 skipped.

- The piper port is bound synchronously at startup (PiperServer.TryBind), and a
  bind that fails is logged and shown. It used to fault a task nothing looked
  at until exit, so the tray ran without its listener, holding the mutex, and
  then crashed on the way out.
- A locking process is killed only while it is the one Restart Manager
  reported: LockingProcess keeps the start time it gave, and Kill compares it
  with the process it opens. The kill can follow a dialog that waits on the
  user, and Windows reuses ids.
- "Open diff tool" finds the move again by its received file when clicked, and
  AddMove takes the process it disposes off the move it was on. A menu built
  before a re-run's move threw on the UI thread.
- The accept loop catches a bare SocketException ConnectionReset, which is
  what a connection that reset before it was accepted throws, instead of
  showing the modal "open an issue" box on the loop's thread. Each connection
  is handled on its own task.
- FileComparer opens both files shared with writers and deleters, so a test's
  rewrite or delete of its received file is not refused during a compare, and
  a pass that reads less from one file than the other is a difference rather
  than the end of both.
- "Always kill locking processes" applies to accepts arriving over the socket,
  which never prompt and so never reached the resolver that read it.
@SimonCropp
SimonCropp merged commit 533d8f3 into main Sep 23, 2026
8 of 9 checks passed
@SimonCropp SimonCropp added this to the 20.5.0 milestone Sep 23, 2026
@SimonCropp
SimonCropp deleted the fix-tray branch September 23, 2026 05:23
This was referenced Sep 23, 2026
This was referenced Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant