hotfix/cp-12810-push-notification-toggle-malfunction-in-android-test-app

UN
10d ago
+92-18

Fix parent and subtopic checkbox synchronization in topics dialog


[!NOTE]
Medium Risk
Changes subscription topic selection UI and in-memory selectedTopics before save; incorrect sync could mis-target push topics but scope is limited to the topics dialog.

Overview
Fixes parent/subtopic checkbox behavior in the Android topics dialog (setupTopicChildCheckboxes).

Child rows are built in one indented layout with tracked checkbox lists. Re-entrant listener guards stop parent and child OnCheckedChangeListener callbacks from looping when one side updates the other.

Parent checked toggles all children in the UI, keeps selectedTopics in sync (including when child listeners are skipped), shows/hides the child group, and refreshes bulk Select/Remove buttons after children change.

Child checked updates that subtopic and checks the parent without unchecking the parent when a child is cleared; the parent id is added to selectedTopics when the parent listener is suppressed.

Previously, child layout setup ran inside the loop and parent/child state could diverge on save.

Reviewed by Cursor Bugbot for commit 9906be948191acc8a263a3020c8254b6f253e406. Bugbot is set up for automated code reviews on this repo. Configure here.