#4377

fix(networking): recover shared relay clients and preserve write order

OpenSalazareowants to merge intofrom

Distinguish relay failures from individual stream errors, discard failed shared clients with transport cleanup, and flush queued socket writes before open callbacks.

Relay runtime error classification needs validation against the deployed runtime.

Validation on this isolated branch: 112 sdk tests across 4 suites. git diff --check passed.

Activity

4
github-actions[bot]3d ago

Coverage Report for puter.js SDK

StatusCategoryPercentageCovered / Total
🔵Lines59.26%
⬇️ -0.22 pp
5266 / 8885
🔵Statements57.38%
⬇️ -0.21 pp
5607 / 9771
🔵Functions58.83%
⬇️ -0.50 pp
972 / 1652
🔵Branches52.46%
⬇️ -0.23 pp
3549 / 6764
File Coverage
FileStmtsBranchesFunctionsLinesUncovered Lines
Changed Files
src/puter-js/src/modules/networking/PSocket.js35.65%
⬇️ -0.48 pp
30.12%
⬇️ -1.38 pp
66.66%
🟰 ±0 pp
36.22%
⬇️ -0.22 pp
8, 12, 16, 29, 115, 131-155, 165-166, 179, 184-286, 301-326, 331, 341
src/puter-js/src/modules/networking/epoxy.js4.1%
⬇️ -3.40 pp
0%
🟰 ±0 pp
0%
🟰 ±0 pp
4.16%
⬇️ -3.34 pp
7-137, 143-154
src/puter-js/src/modules/networking/index.js57.97%
⬇️ -14.94 pp
41.02%
⬇️ -8.98 pp
72.72%
⬇️ -7.28 pp
57.97%
⬇️ -14.94 pp
22, 46, 65-69, 73-75, 83-88, 97, 105-107, 126, 144-163, 179
src/puter-js/src/modules/networking/requests.js72.5%
⬆️ +2.74 pp
62.5%
⬆️ +0.74 pp
100%
🟰 ±0 pp
72.5%
⬆️ +2.74 pp
8-14, 31-34, 41, 79, 102-113
Generated in workflow #1671 for commit 053b1ca by the Vitest Coverage Report Action
r58Playzreviewed3d ago
r58Playz3d ago

from my codex: Found one issue in f04c1b5:

  • [P2] Writes can remain queued forever after the initial flush — PSocket.js:204–208. After the flush empties the queue, await yields before #flushing resets. A write arriving in that gap gets queued, but nothing drains it afterward. The socket emits open while the payload remains unsent and its callback never runs. Reset the flag synchronously with the final queue check.

other than that lgtm