Skip to content

fix(Android): ignore reload callbacks after teardown - #8358

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/safe-reload-listener-teardown
Open

fix(Android): ignore reload callbacks after teardown#8358
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/safe-reload-listener-teardown

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem and fix

Both Android reload handlers replaced their listener with null during teardown. A late dev-bundle onSuccess() callback then dereferenced that null listener:

  • JsDevReloadHandler can receive a bundle-download completion after its NavigationActivity has been destroyed and removed
  • ReloadHandler remained callable after destroy() through the same callback interface

This change restores the no-op listener each handler already uses before initial registration. Late callbacks are safely ignored without retaining the destroyed listener or adding nullable checks to every call site.

Regression coverage

  • JsDevReloadHandlerTest removes an activity listener and invokes a late success callback
  • ReloadListenerTest destroys the generic handler and invokes a late success callback

Both exact baseline paths throw NullPointerException; the fixed focused suite passes 3/3.

Verification

  • focused reload suites: 3/3 passed
  • full Android unit suite: 699 passed, 2 skipped, 0 failed
  • Android debug Java/Kotlin compilation passed
  • git diff --check passed

Breaking changes

None. Callbacks after teardown are now ignored instead of crashing.

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