Skip to content

fix: address remaining review findings - #552

Merged
Linuxuser67 merged 1 commit into
mainfrom
fix/review-remaining-findings
Oct 27, 2026
Merged

Linuxuser67 merged 1 commit into
mainfrom
fix/review-remaining-findings

Conversation

@Linuxuser67

@Linuxuser67 Linuxuser67 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #548, covering the remaining findings from the audited review of main at 6de8538. Finding 8 (file/test-file size) is out of scope and stays shelved.

Changes

  • Strict hex decoding (src/extension_server.rs): hex_decode now rejects anything that is not an ASCII hex digit. u8::from_str_radix accepts a leading +, so "+f" and "0f+0" decoded successfully before. Added a unit test for those inputs (and for odd-length / non-hex).
  • SAFETY comments (src/video_tools.rs): documented the two unsafe blocks in real_home_dir — sysconf (no pointers) and CStr::from_ptr(entry.pw_dir) (non-null after a successful getpwuid_r, bytes copied before the buffer can change).
  • Poison handling (src/gallery_runner.rs): the two stderr-tail locks now go through runtime::lock_recover like every other worker-shared mutex, instead of .lock().unwrap(). A panicking stderr task can no longer take the download down with it.
  • Suppression reasons: every suppression now carries a reason, and the live clippy::too_many_arguments, clippy::type_complexity and clippy::needless_borrow suppressions are #[expect(..., reason = "...")], so a future clippy that stops firing them fails the build instead of leaving dead allowances behind. Dropped the four too_many_arguments allowances that no longer fire (their functions take at most 7 arguments). The test-module await_holding_lock stays an allow (test-only by design) but now has a reason.
  • Legacy branch removal date (src/extension_server.rs): the paired-extension compatibility branch is now dated for removal after 2027-03-01. Adjust the date if it does not match the extension's update window.
  • Tombstone removal (src/runtime.rs): deleted the empty #[cfg(test)] mod tests that only documented a deleted test.

Findings #4 (naming) and #7 (serial-test docs) needed no code: CONTRIBUTING.md already documents RUST_TEST_THREADS=1 and the serial test run.

Verification

  • No Rust toolchain is available in this environment, so cargo fmt --check, cargo clippy and the test suite were not run locally; CI is the gate.
  • git diff --check is clean.
  • The first CI run confirmed the type_complexity suppression is still live at clippy 1.99 (the earlier local score estimate of 200 was wrong), so it is kept as an #[expect].
  • Note: the needless_borrow suppression documents a clippy false positive inside let-chains (1.99). If clippy fixes it, the new #[expect] will flag the stale suppression — that is the intended behavior.

Follow-up to #548 for the audited review of main at 6de8538:

- Reject non-hex characters in the extension's hex decoder: `from_str_radix`
  accepts a leading `+`, so "+f" decoded successfully before. Covered by a
  unit test.
- Document both `unsafe` blocks in `real_home_dir` with SAFETY comments.
- Route the gallery stderr-tail locks through `runtime::lock_recover` instead
  of unwrapping on poison.
- Turn live clippy suppressions into `#[expect(..., reason = "...")]` and drop
  the four `too_many_arguments` allowances that no longer fire (their
  functions take at most 7 arguments).
- Date the legacy paired-extension branch for removal after 2027-03-01.
- Delete the empty `runtime` test module left by a removed test.
@Linuxuser67
Linuxuser67 force-pushed the fix/review-remaining-findings branch from ae6c239 to bac1de5 Compare October 27, 2026 07:11
@Linuxuser67
Linuxuser67 merged commit e47482f into main Oct 27, 2026
5 checks passed
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