fix(react-native): scope companion streams to bridge generation

Merged
TH
3d ago
+539-110

Summary

  • Preserve stream ownership through the upstream close callback so bridge close requests receive one terminal notification.
  • Keep stale sockets quiet, return one failed open result for an owning pre-open close, and simplify the worker’s connection and retry loop.
  • Scope remains the React Native companion worker; no linked issue was supplied.

Before / after

No observable protocol or command shape change. Close, replacement, and disconnect interleavings now settle once for their owning generation.

Validation

CI owns validation for b7340b60b842257decc09c4cf0e9f59d23e9058b; checks are pending. Coverage at 0cab76fdc2056e74479504b645adaa7bd42bcab8 failed because the replacement test expected 1012 instead of the normalized client close code 3001. The assertion now retains the reason and ownership checks. No local tests, gates, builds, or devices were run.