Skip to content

fix: resolve silent deactivation, probe timeout, and stdin swallowing - #636

Open
umran666 wants to merge 1 commit into
DietrichGebert:mainfrom
umran666:fix/ponytail-minor-leaks
Open

fix: resolve silent deactivation, probe timeout, and stdin swallowing#636
umran666 wants to merge 1 commit into
DietrichGebert:mainfrom
umran666:fix/ponytail-minor-leaks

Conversation

@umran666

Copy link
Copy Markdown

This PR cleans up a few minor structural leaks in the background

  1. Silent Deactivation (pi-extension/index.js): Fixed a bug where typing "stop ponytail" or "normal mode" deactivated the ruleset silently. The input event listener was dropping the ctx object, so setMode("off") couldn't trigger the UI notification. Wired ctx through so the user actually gets a visual confirmation that it turned off.

  2. Python Probe Timeout Trap (benchmarks/correctness.js): The environment probe for the Python command was lazily evaluating its timeout. If a test temporarily dropped the timeout to 1ms before the probe fired, both the python3 and python checks would fail. It would then wrongly fall back to python3, breaking tests on Windows machines where only python.exe exists. Hardcoded a 5000ms timeout specifically for the initialization probe so it's immune to test modifications. Also bumped the correctness test timeout from 1s to 5s to stop flakiness on slower Windows machines during pandas startup.

  3. Stdin JSON Parse Swallow (hooks/ponytail-mode-tracker.js): Added a quick guard rail to prevent JSON.parse('') from throwing a SyntaxError if stdin receives completely empty input (like from a pipe hiccup or PowerShell swallowing the stream).

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