Skip to content

fix(android): serialize factory teardown and share callback guards - #71

Merged
greenfrvr merged 1 commit into
pc-dispose-racefrom
fix/pc-dispose-lifecycle
Sep 22, 2026
Merged

greenfrvr merged 1 commit into
pc-dispose-racefrom
fix/pc-dispose-lifecycle

Conversation

@santhoshvai

Copy link
Copy Markdown
Member

A createCallFactory() queued during two-phase teardown can reuse a factory that the pending teardown then destroys. Concurrent creates replacing a bare-fork default can likewise destroy the first successful create's factory. Queue factory lifecycle requests until teardown completes, preserving request order and allowing peer-connection callbacks to drain between phases.

Centralize the five success-callback disposal checks in runWithPeerConnection(). The helper checks the connection inside the executor task and passes it to the callback. Also share peer-connection disposal, observer removal, and factory unbinding between the explicit and factory teardown paths.

This draft targets pc-dispose-race, the branch of #70.

Validation:

  • Android Java/Kotlin compilation passed with Gradle 9.4.1, AGP 9.2.1, and React Native 0.87.0 using a temporary host project.
  • Eight local JVM regression scenarios passed using the production lifecycle methods, registry, and executor with native dependencies stubbed: overlapping dispose/create, concurrent default replacement, reference counts, FIFO request completion, close callback draining, disposed/live callback handling, and cleanup after a PC disposal exception.
  • git diff --check passed.

The regression harness was local; no Android device runtime test was performed.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 976188b0-a4c0-41c3-bd4a-09a97a572a85

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greenfrvr
greenfrvr marked this pull request as ready for review September 22, 2026 13:27
@greenfrvr
greenfrvr merged commit cbc87df into pc-dispose-race Sep 22, 2026
2 checks passed
@greenfrvr
greenfrvr deleted the fix/pc-dispose-lifecycle branch September 22, 2026 13:27
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