Skip to content

fix(Android): restore custom row listener on reattach - #8356

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/restore-custom-row-listener
Open

fix(Android): restore custom row listener on reattach#8356
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/restore-custom-row-listener

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem and fix

BottomTabsCustomRow registered its process-wide configuration listener only during construction and removed it when detached. BottomTabsCustomRowAttacher.ensureRowHostedOn can detach and reattach the same row when its host changes, leaving that row permanently unsubscribed from later configuration updates.

This change ties the listener to the actual view lifecycle:

  • register in onAttachedToWindow
  • remove in onDetachedFromWindow
  • apply the store's latest configuration on every attachment, covering updates that arrived while detached

The listener store is a set, so attachment registration remains idempotent.

Regression coverage

The new Robolectric test verifies that:

  • an attached row receives configuration updates
  • a detached row does not
  • reattachment immediately catches up to the current configuration
  • later updates continue to reach the reattached row

Verification

  • focused regression: 1/1 passed
  • full Android unit suite: 698 passed, 2 skipped, 0 failed
  • Android debug Kotlin/Java compilation passed
  • git diff --check passed

Breaking changes

None. This restores expected updates for an existing row after re-hosting.

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