Repository navigation
fix: refresh once-a-day marker files on Windows - #4047
Conversation
The hook reminder and telemetry markers were refreshed with `fs::write(path, b"")`. Rewriting an existing empty file with empty content does not update its modification time on Windows, so once a marker was older than 24 hours the rate limit never applied again: the "No hook installed" reminder was printed on every command. Add `utils::touch_file`, which sets the modification time explicitly, and use it for both markers.
📊 Automated PR Analysis
SummaryFixes a Windows bug where once-a-day marker files (hook reminder and telemetry ping) never had their modification time updated because Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Thanks for this one, the diagnosis is spot on. I reproduced it natively on Windows (NTFS): rewriting an already-empty marker with I merged One more marker landed after you opened this: the Pro hint in |
pszymkowiak
left a comment
There was a problem hiding this comment.
CI is green across the board on the refreshed branch, including both Windows jobs. Thanks again @yuefdev.
Summary
The hook reminder and telemetry markers were refreshed with
fs::write(path, b""). Rewriting an existing empty file with empty content does not refresh its modification time on Windows, so an expired marker could allow the warning or ping on every command.utils::touch_filecreates the marker if needed and explicitly updates its modification time withFile::set_modified. Both marker paths use it.The current
developbranch is merged. The conflict insrc/core/utils.rskeeps both the marker regression and the upstream terminal-sanitisation regression.Validation
cargo fmt --all -- --checkcargo fmt --manifest-path proxy/Cargo.toml --all -- --checkcargo clippy --all-targetscargo test --allAll checks passed on Ubuntu with Rust 1.99.1, Git 2.51.0 and
RUST_TEST_THREADS=1. The main library reported 4,323 passed and eight ignored tests. Integration, workspace and documentation tests also passed. A timed-out run was resumed by running the remaining targets against the same staged tree.The Linux checkout's tree matched the submitted tree,
2e9663d71abca991dcf7dddd7f733599bcae9bff. An engine example binary initially failed in the Linux loader before its tests started; rebuilding that package made its full test run pass.test_touch_file_refreshes_existing_empty_markercreates a marker, backdates it by two days, touches it and checks its age and empty contents.AI-assisted implementation and validation using
gpt-6.1-sol.