Skip to content

Keep a row's state when a release adds a rule to it - #48

Merged
kasnder merged 2 commits into
mainfrom
ccr-5fcee933-sibling-state
Oct 21, 2026
Merged

kasnder merged 2 commits into
mainfrom
ccr-5fcee933-sibling-state

Conversation

@kasnder

@kasnder kasnder commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

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 calls inheritSiblingState(), 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 grouping RuleRows.mergeRules uses). 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-end getRules() 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

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
@kasnder
kasnder added this pull request to stack #50 October 21, 2026 08:31
@kasnder
kasnder marked this pull request as ready for review October 21, 2026 08:31
@kasnder
kasnder merged commit 276fee4 into main Oct 21, 2026
1 check 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.

2 participants