fix(gui): apply the target field only through Apply changes - #211
Merged
Merged
Conversation
Every tick pushed the raw "Target process" field to the running engine. Clearing the field to type a new name, or a half-typed expression such as re:^fire(, switched process targeting off, so every connection in the filter was impaired - without the unbounded-impairment warning and with a banner saying traffic was NOT being impaired. - The tick only reads the verdict on what START / Apply applied; the field snapshot and the tick-side apply are gone. - New banner text when an applied target cannot be used (no psutil, an expression that narrows nothing): every connection is impaired. - The banner clears when the session stops. - Tests that pinned the tick-side apply were rewritten; the row-action guard now ticks. Five new mutation entries, all caught. The class and file ratchets move down with the removed code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 26 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every GUI tick pushed the raw Target process field to the running engine, without Apply changes:
re:^fire(.This broke the rule the README states for the whole form: nothing applies itself.
The cause is a leftover of the old background target refresher. START and Apply changes already applied the target properly, through
apply_settings: validated, announced, and followed by the unbounded warning. The tick added a second, unvalidated path on top of that. After START it also re-applied the field instead of the validated start settings.Changes (
gui/app.py)_refresh_targetbecomes_refresh_target_verdict. It readsengine.targeting()and never applies anything._snapshot_targetand_target_exprare removed._applied_targetnow means "what START / Apply changes applied". It is set from the validated settings in_finish_startandapply_if_running. The "apply needed" log line after a row action is now true for the target field too.fields.target_all_traffic(en/pl/zh). It shows when a target was applied but cannot be used, for example no psutil, or an expression that narrows nothing. In that case every connection is impaired, and the note says so instead of the opposite.Tests
Rewritten on purpose, because they pinned the tick-side apply or called the removed methods:
test_a_row_action_fills_the_form_and_does_not_reach_a_running_enginenow ticks. It never did, so it stayed green while the rule it names was broken on every tick.test_a_gui_session_keeps_the_target_banner_honestsets targets through Apply. It asserts that an emptied or a half-typed field reaches nothing through 0.4 s of ticks, that no targeting error is logged, and that Apply is lit._TARGET_SESSION.test_a_target_that_cannot_be_used_says_everything_is_impaired, covering START, Apply of an empty field, Apply again, and STOP.Mutation proof: five new entries, all caught.
All 37
gui:and 7ratchet:entries were run and caught.Ratchets move down with the removed code: the file ceiling from 1166 to 1150, App methods from 96 to 95, App attributes from 80 to 79, and silent handlers in
gui/app.pyfrom 13 to 12.Run locally:
ruffandmypy;Not run locally: the full suite (it runs here on Linux and Windows).
🤖 Generated with Claude Code