Skip to content

Stop obsolete missing-log watches from replacing selected output - #68

Open
ddri wants to merge 1 commit into
fedonman:mainfrom
ddri:codex/fix-obsolete-log-watch
Open

ddri wants to merge 1 commit into
fedonman:mainfrom
ddri:codex/fix-obsolete-log-watch

Conversation

@ddri

@ddri ddri commented Oct 15, 2026

Copy link
Copy Markdown

Selecting a job whose log does not exist starts a detached polling thread. If the user switches to another job before the old log appears, that thread later sends WatchPath(old_path) and replaces the selected job's output. The same pending watch can restart a cleared/hidden pane.

Keep the pending path in the observer event loop instead. A new selection or clear revokes it, and the existing polling interval still discovers the currently selected file when it appears. Removing the observer's sender to its own inbox also lets dropping LiveFileMonitor disconnect and stop the observer.

This covers the missing-file edge case left after #58. It changes only the file monitor and changelog; it does not include the separate fake-Slurm harness work in #42.

Reproduction and validation

  1. Select missing output file A.
  2. Select existing output file B and receive B's content.
  3. Create A. Before this fix, A's content arrives despite B still being selected; afterward, it does not.

Four regression tests cover switching jobs, clearing a pane, dropping a monitor, and normal creation of the currently selected file. Applied to original 8d2ca3b, the first three fail and the fourth passes; with the fix, all four pass.

Verified locally on macOS arm64 with Rust 1.94.1:

  • cargo test --locked --offline: 67 library, 3 CLI and 8 parsing tests pass.
  • cargo fmt --all --check
  • cargo clippy --locked --offline --all-targets -- -D warnings
  • cargo +1.90.0 check --locked --offline --all-targets: declared MSRV passes.

Tests use temporary files and require no Slurm installation or controller. Linux verification is left to upstream CI.

AI assistance disclosure: prepared with OpenAI Codex. Source review, regression tests and the local validation above were performed by the coding agent; this submission was authorized by the account owner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant