Repository navigation
Keep a row's state when a release adds a rule to it - #48
Merged
Merged
Conversation
A row of sibling rules is on only while every rule in it is, and a new rule starts off. So when a release adds a rule to an existing row, as #46 and #47 do for LinkedIn and WhatsApp, the row turns off for every user who had it on, and their block silently stops. getRules() now gives a built-in rule that has no saved state the saved enabled flag and pause of a sibling in its row. Custom and navigation rules are left alone: custom rows are built by the user, and navigation rules have their own key space. Claude-Session: https://claude.ai/code/session_01GwnAB5CENNRMKt5vqGLKcS
The gmwaylite flavour bundles no LinkedIn rules, so the row the test checks has a single rule there. The standard flavour still runs it. Claude-Session: https://claude.ai/code/session_01GwnAB5CENNRMKt5vqGLKcS
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.
Concern addressed: Adding a built-in rule to an existing row (as #46 and #47 do) switches that row off for everyone who had it on.
What changed and why: A row is on only while every rule in it is, and a new rule has no saved state, so it starts off.
ServiceConfig.getRules()now callsinheritSiblingState(), which gives a built-in rule with no saved state the saved enabled flag and pause of a sibling in the same row (same package and comment, the groupingRuleRows.mergeRulesuses). Rules with their own saved state are untouched. Custom rules and navigation rules are excluded.This is also the prerequisite for downloaded rule updates (stacked PR to follow), which would otherwise switch rows off with every update.
Evidence: Added unit tests in
ServiceConfigTest: inherits enabled state, inherits a pause, keeps a rule's own state, does not cross apps or touch custom rules, leaves a row with no saved state alone, and an end-to-endgetRules()check that the bundled LinkedIn "Hide feed item" row stays on. Not run locally: no Android SDK in this container. CI is the first run.Not in this PR: Nothing else.
https://claude.ai/code/session_01GwnAB5CENNRMKt5vqGLKcS
Generated by Claude Code