Skip to content

fix(sni-connect): add shared request admission queue - #81

Open
huhuanming wants to merge 5 commits into
mainfrom
codex/sni-request-admission
Open

fix(sni-connect): add shared request admission queue#81
huhuanming wants to merge 5 commits into
mainfrom
codex/sni-request-admission

Conversation

@huhuanming

@huhuanming huhuanming commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add requestId, per-runtime cancellation APIs, and debug snapshots to the public SNI JS/native API
  • add process-shared Android and iOS admission control with global 64, pair 16, and pending 256 limits
  • queue requests within a wall-clock deadline, canonicalize IP pairs, and make pending/active cancellation race-safe
  • cover admission, cancellation, overflow, timeout, canonical IP, snapshot IDs, and queue draining in native tests
  • bump all 35 publishable workspaces to 3.0.81 and document the release in CHANGELOG.md

Why

The app-monorepo currently carries these SNI request-queue and cancellation behaviors as a package patch. Moving them into the maintained package source removes that patch dependency and ensures main/background React Native runtimes share capacity while retaining cancellation ownership per runtime.

Impact

  • requests beyond active capacity are queued instead of immediately rejected
  • total request timeout includes queue wait; transports receive only the remaining timeout
  • duplicate request IDs cancel the older request without allowing stale callbacks to unregister the replacement
  • public-IP, SNI/TLS hostname, direct-connect, no-redirect, HTTP/1.1, and existing size/timeout validation boundaries remain intact
  • app-monorepo can upgrade to @onekeyfe/react-native-sni-connect@3.0.81 and remove the downstream patch

Validation

  • corepack yarn install --immutable ? passed
  • corepack yarn workspace @onekeyfe/react-native-sni-connect prepare ? passed
  • corepack yarn workspace @onekeyfe/react-native-sni-connect typecheck ? passed
  • corepack yarn workspace @onekeyfe/react-native-sni-connect test --runInBand ? passed (6/6)
  • corepack yarn workspace @onekeyfe/react-native-sni-connect test:android ? passed (19/19)
  • macOS/iOS VM swift test ? passed (20/20)
  • iOS Simulator XCTest ? passed (20/20)
  • New Architecture CocoaPods/example Simulator Debug build ? passed (BUILD SUCCEEDED)
  • Legacy Architecture ? not validated: React Native 0.83 forces New Architecture even when the temporary Pod configuration requests RCT_NEW_ARCH_ENABLED=0
  • git diff --check ? passed

The iOS runtime harness does not cover real-network cancelAllRequests, response-body cancellation, cross-runtime ownership, or duplicate-ID replacement; those paths were source-reviewed and compiled under New Architecture.

Publishing

  • Initial workflow run published @onekeyfe/react-native-sni-connect@3.0.81.
  • Full-workspace workflow run published the other 34 packages at 3.0.81.
  • The full-workspace run is red only because the already-published SNI 3.0.81 was rejected as a duplicate; its log contains 34 successful publishes and no other npm error.
  • Registry metadata independently verifies all 35 publishable packages have latest=3.0.81.

@huhuanming
huhuanming marked this pull request as ready for review August 3, 2026 15:46
Comment thread native-modules/react-native-sni-connect/ios/SniConnectClient.swift
Comment thread native-modules/react-native-sni-connect/ios/SniConnectClient.swift
Comment thread native-modules/react-native-sni-connect/ios/SniConnectClient.swift
Comment thread CHANGELOG.md Outdated
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