@fuzdev/fuz_app 0.182.0 → 0.184.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/actions/CLAUDE.md +535 -1223
- package/dist/actions/action_codegen.d.ts +1 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +3 -2
- package/dist/actions/connection_closer.d.ts +11 -9
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +11 -9
- package/dist/actions/frontend_rpc_client.d.ts +1 -1
- package/dist/actions/register_action_ws.d.ts +14 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +2 -1
- package/dist/actions/ws_socket_session.d.ts +9 -1
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +43 -19
- package/dist/auth/CLAUDE.md +430 -1024
- package/dist/auth/account_queries.d.ts +1 -1
- package/dist/auth/account_queries.js +1 -1
- package/dist/auth/account_routes.d.ts +9 -8
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +78 -75
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +32 -28
- package/dist/auth/api_token.d.ts +20 -3
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +28 -9
- package/dist/auth/api_token_queries.d.ts +2 -2
- package/dist/auth/api_token_queries.js +2 -2
- package/dist/auth/audit_emitter.d.ts +75 -84
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +83 -71
- package/dist/auth/audit_log_schema.d.ts +25 -14
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +23 -8
- package/dist/auth/auth_guard_resolver.d.ts +1 -1
- package/dist/auth/auth_guard_resolver.js +1 -1
- package/dist/auth/bearer_auth.d.ts +2 -5
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +4 -13
- package/dist/auth/bootstrap_account.d.ts +42 -26
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +36 -19
- package/dist/auth/bootstrap_routes.d.ts +20 -21
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +26 -31
- package/dist/auth/bootstrap_token_store.d.ts +3 -4
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -1
- package/dist/auth/bootstrap_token_store.js +1 -1
- package/dist/auth/daemon_token.d.ts +5 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +12 -8
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +15 -21
- package/dist/auth/deps.d.ts +19 -5
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/deps.js +3 -2
- package/dist/auth/invite_queries.d.ts +51 -3
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +81 -6
- package/dist/auth/invite_schema.d.ts +2 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts +2 -3
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +3 -3
- package/dist/auth/request_context.d.ts +3 -3
- package/dist/auth/request_context.js +3 -3
- package/dist/auth/resolved_auth.d.ts +7 -7
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +4 -4
- package/dist/auth/role_grant_offer_actions.d.ts +27 -3
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +42 -35
- package/dist/auth/role_grant_offer_queries.d.ts +60 -4
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +79 -5
- package/dist/auth/role_grant_queries.d.ts +3 -52
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +5 -80
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +11 -22
- package/dist/auth/session_cookie.d.ts +82 -174
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +80 -130
- package/dist/auth/session_middleware.d.ts +8 -17
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +14 -23
- package/dist/auth/session_queries.d.ts +15 -17
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +28 -20
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +93 -43
- package/dist/db/CLAUDE.md +5 -3
- package/dist/db/sql_columns.d.ts +1 -1
- package/dist/db/sql_columns.js +1 -1
- package/dist/dev/setup.d.ts +3 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +3 -1
- package/dist/http/CLAUDE.md +315 -763
- package/dist/http/db_routes.d.ts +8 -23
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +73 -73
- package/dist/http/origin.d.ts +7 -8
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +7 -8
- package/dist/http/pending_effects.d.ts +118 -6
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +114 -6
- package/dist/http/route_result.d.ts +1 -1
- package/dist/http/route_spec.d.ts +14 -11
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/realtime/sse.d.ts +4 -23
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +4 -25
- package/dist/server/app_backend.d.ts +4 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +3 -1
- package/dist/server/app_server.d.ts +80 -16
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +113 -31
- package/dist/server/app_server_context.d.ts +1 -2
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.js +2 -2
- package/dist/testing/CLAUDE.md +265 -796
- package/dist/testing/admin_integration.d.ts +2 -3
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +3 -3
- package/dist/testing/adversarial_404.d.ts +6 -1
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +38 -17
- package/dist/testing/app_server.d.ts +23 -148
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +53 -131
- package/dist/testing/attack_surface.d.ts +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts +2 -3
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +1 -1
- package/dist/testing/audit_drift_guard.d.ts +11 -6
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +15 -8
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts +12 -9
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/audit_cross_helpers.js +13 -14
- package/dist/testing/cross_backend/capabilities.d.ts +9 -6
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +11 -7
- package/dist/testing/cross_backend/capability_mounts.d.ts +103 -0
- package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -0
- package/dist/testing/cross_backend/capability_mounts.js +428 -0
- package/dist/testing/cross_backend/cell_moderate.js +2 -2
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +12 -11
- package/dist/testing/cross_backend/conformance_principal.d.ts +54 -0
- package/dist/testing/cross_backend/conformance_principal.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_principal.js +283 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +7 -56
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +6 -274
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_deadline.js +2 -0
- package/dist/testing/cross_backend/credential_wire.d.ts +1 -1
- package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -1
- package/dist/testing/cross_backend/db_state_diff.d.ts +72 -0
- package/dist/testing/cross_backend/db_state_diff.d.ts.map +1 -0
- package/dist/testing/cross_backend/db_state_diff.js +444 -0
- package/dist/testing/cross_backend/declared_skips.d.ts +68 -0
- package/dist/testing/cross_backend/declared_skips.d.ts.map +1 -0
- package/dist/testing/cross_backend/declared_skips.js +132 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts +3 -3
- package/dist/testing/cross_backend/default_spine_surface.d.ts +0 -6
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +4 -9
- package/dist/testing/cross_backend/differential.d.ts +13 -5
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +35 -11
- package/dist/testing/cross_backend/differential_normalize.d.ts +12 -0
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential_normalize.js +16 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts +1 -42
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +45 -4
- package/dist/testing/cross_backend/in_process_setup.d.ts +28 -19
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +156 -142
- package/dist/testing/cross_backend/login_security.d.ts +12 -0
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +21 -4
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +0 -2
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -1
- package/dist/testing/cross_backend/request_target_conformance_wire.js +3 -1
- package/dist/testing/cross_backend/revocation_drivers.d.ts +18 -5
- package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
- package/dist/testing/cross_backend/revocation_drivers.js +18 -10
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +1 -1
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +33 -1
- package/dist/testing/cross_backend/role_grant_participation.js +4 -4
- package/dist/testing/cross_backend/rpc_adversarial.js +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -4
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +2 -2
- package/dist/testing/cross_backend/session_cap.d.ts +2 -2
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +22 -11
- package/dist/testing/cross_backend/setup.d.ts +32 -2
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +32 -1
- package/dist/testing/cross_backend/spine_suites.d.ts +125 -15
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +459 -62
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
- package/dist/testing/cross_backend/sse_round_trip.d.ts +9 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +123 -27
- package/dist/testing/cross_backend/standard.d.ts +2 -3
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +3 -3
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -2
- package/dist/testing/cross_backend/testing_credential_read.d.ts +10 -11
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_credential_read.js +12 -12
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +84 -47
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +95 -63
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +2 -3
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +7 -3
- package/dist/testing/cross_backend/ws_round_trip.d.ts +5 -0
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +54 -8
- package/dist/testing/daemon_token_rotation.d.ts.map +1 -1
- package/dist/testing/daemon_token_rotation.js +2 -3
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -0
- package/dist/testing/db.d.ts +0 -32
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +0 -86
- package/dist/testing/db_entities.d.ts +14 -0
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +17 -0
- package/dist/testing/db_invariant_queries.d.ts +259 -0
- package/dist/testing/db_invariant_queries.d.ts.map +1 -0
- package/dist/testing/db_invariant_queries.js +400 -0
- package/dist/testing/db_invariants.d.ts +106 -0
- package/dist/testing/db_invariants.d.ts.map +1 -0
- package/dist/testing/db_invariants.gen.sql.d.ts +11 -0
- package/dist/testing/db_invariants.gen.sql.d.ts.map +1 -0
- package/dist/testing/db_invariants.gen.sql.js +13 -0
- package/dist/testing/db_invariants.js +141 -0
- package/dist/testing/db_invariants.sql +152 -0
- package/dist/testing/describe_db.d.ts +36 -0
- package/dist/testing/describe_db.d.ts.map +1 -0
- package/dist/testing/describe_db.js +71 -0
- package/dist/testing/integration.d.ts +8 -12
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +13 -17
- package/dist/testing/integration_helpers.d.ts +1 -1
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/rate_limiting.d.ts +3 -4
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +6 -5
- package/dist/testing/role_grant_helpers.d.ts +1 -1
- package/dist/testing/role_grant_helpers.d.ts.map +1 -1
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +3 -0
- package/dist/testing/rpc_attack_surface.d.ts +8 -6
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +69 -6
- package/dist/testing/rpc_helpers.d.ts +1 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -3
- package/dist/testing/rpc_round_trip.d.ts +3 -4
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +4 -1
- package/dist/testing/sse_round_trip.d.ts +3 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +15 -6
- package/dist/testing/stubs.d.ts +9 -8
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +20 -13
- package/dist/testing/test_app.d.ts +168 -0
- package/dist/testing/test_app.d.ts.map +1 -0
- package/dist/testing/test_app.js +123 -0
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +3 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +1 -2
- package/package.json +1 -1
|
@@ -139,7 +139,7 @@ export type ActionMethodEnumKind = 'all' | 'request_response' | 'remote_notifica
|
|
|
139
139
|
* `BroadcastActionMethod`. Pairs each runtime const with an `Infer` type
|
|
140
140
|
* alias under the same identifier. A const's `def` is its array of methods.
|
|
141
141
|
*
|
|
142
|
-
* Protocol-action methods (`heartbeat`, `cancel`) are filtered out by
|
|
142
|
+
* Protocol-action methods (`heartbeat`, `cancel`, `peer/ping`) are filtered out by
|
|
143
143
|
* default — pass `include_protocol_actions: true` if a consumer genuinely
|
|
144
144
|
* wants them on their typed surface. Empty kinds are skipped, so every
|
|
145
145
|
* emitted const names at least one method.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_codegen.d.ts","sourceRoot":"","sources":["../../src/lib/actions/action_codegen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG1E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,+CAAgD,CAAC;AAErF,8FAA8F;AAC9F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI5E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI,oBACrC,CAAC;AAEjC,UAAU,UAAU;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;;IACzB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAa;IAE1D;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAQrC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1C,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,K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MAAM,CAAC;IAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;CAAE,KACzE,MA+BF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,4BAA4B,GACxC,OAAO,aAAa,CAAC,eAAe,CAAC,EACrC,SAAS,aAAa,EACtB,UAAU;IACT,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,CAAC;IACjD,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC,KACC,MA2CF,CAAC;AAMF;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,0BAA0B,GACtC,SAAS,aAAa,CAAC,UAAU,CAAC,EAClC,SAAS,aAAa,KACpB;IACF,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,CAAC;IAChD,SAAS,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CAiC1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B,KAAG,MAYH,CAAC"}
|
|
@@ -483,7 +483,8 @@ const action_method_enum_kinds_all = new Set([
|
|
|
483
483
|
'broadcast'
|
|
484
484
|
]);
|
|
485
485
|
/**
|
|
486
|
-
* Filter `heartbeat` /
|
|
486
|
+
* Filter the protocol actions (`heartbeat`, `cancel`, `peer/ping`) out of
|
|
487
|
+
* `specs` unless the consumer opts back in.
|
|
487
488
|
* Protocol actions ship from fuz_app and are spread into every consumer's
|
|
488
489
|
* `actions` array at registration time (via `protocol_actions` from
|
|
489
490
|
* `actions/protocol.ts`) — they should not appear in consumer-owned typed
|
|
@@ -520,7 +521,7 @@ const resolve_spec_qualifier = (imports, options) => {
|
|
|
520
521
|
* `BroadcastActionMethod`. Pairs each runtime const with an `Infer` type
|
|
521
522
|
* alias under the same identifier. A const's `def` is its array of methods.
|
|
522
523
|
*
|
|
523
|
-
* Protocol-action methods (`heartbeat`, `cancel`) are filtered out by
|
|
524
|
+
* Protocol-action methods (`heartbeat`, `cancel`, `peer/ping`) are filtered out by
|
|
524
525
|
* default — pass `include_protocol_actions: true` if a consumer genuinely
|
|
525
526
|
* wants them on their typed surface. Empty kinds are skipped, so every
|
|
526
527
|
* emitted const names at least one method.
|
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
*
|
|
18
18
|
* ## Closing after commit
|
|
19
19
|
*
|
|
20
|
-
* A revocation
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* A revocation must not close a connection until its transaction commits.
|
|
21
|
+
* `queue_connection_close` defers the close onto the request's post-commit
|
|
22
|
+
* queue (`emit_after_commit`): it runs after the commit and is dropped on
|
|
23
|
+
* rollback, so a revocation that never happened closes nothing. A handler
|
|
24
|
+
* that opens its own transaction around just its writes (`/login`,
|
|
25
|
+
* `/password`) closes straight after that commit instead
|
|
26
|
+
* (`close_connections_after_commit`).
|
|
25
27
|
*
|
|
26
28
|
* Two things rest on that order. A client told "revoked" rechecks its session
|
|
27
29
|
* straight away, and before the commit the row it probes is still there. And
|
|
@@ -33,10 +35,10 @@
|
|
|
33
35
|
* ## Why the handlers close directly
|
|
34
36
|
*
|
|
35
37
|
* The audit listener (`create_revocation_guard`) closes connections too, but
|
|
36
|
-
* only once
|
|
37
|
-
*
|
|
38
|
-
* is the one
|
|
39
|
-
*
|
|
38
|
+
* only once a success row whose event type declares a revocation scope is
|
|
39
|
+
* announced — and the session sweep writes no row at all. The handler's own
|
|
40
|
+
* close is the one the revocation owns, so the closer it holds must reach every transport
|
|
41
|
+
* whose connections outlive their credential. `RealtimeCloser` is
|
|
40
42
|
* that fan-out, and `create_app_backend` puts one on `AppDeps`.
|
|
41
43
|
*
|
|
42
44
|
* ## The audit listener
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection_closer.d.ts","sourceRoot":"","sources":["../../src/lib/actions/connection_closer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connection_closer.d.ts","sourceRoot":"","sources":["../../src/lib/actions/connection_closer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAGN,KAAK,aAAa,EAClB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,iBAAiB,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,MAAM,CAAC;IAC7D;;;;;;;OAOG;IACH,qBAAqB,EAAE,MAAM,MAAM,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,IAAI,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|
|
24
|
-
*
|
|
20
|
+
* A revocation must not close a connection until its transaction commits.
|
|
21
|
+
* `queue_connection_close` defers the close onto the request's post-commit
|
|
22
|
+
* queue (`emit_after_commit`): it runs after the commit and is dropped on
|
|
23
|
+
* rollback, so a revocation that never happened closes nothing. A handler
|
|
24
|
+
* that opens its own transaction around just its writes (`/login`,
|
|
25
|
+
* `/password`) closes straight after that commit instead
|
|
26
|
+
* (`close_connections_after_commit`).
|
|
25
27
|
*
|
|
26
28
|
* Two things rest on that order. A client told "revoked" rechecks its session
|
|
27
29
|
* straight away, and before the commit the row it probes is still there. And
|
|
@@ -33,10 +35,10 @@
|
|
|
33
35
|
* ## Why the handlers close directly
|
|
34
36
|
*
|
|
35
37
|
* The audit listener (`create_revocation_guard`) closes connections too, but
|
|
36
|
-
* only once
|
|
37
|
-
*
|
|
38
|
-
* is the one
|
|
39
|
-
*
|
|
38
|
+
* only once a success row whose event type declares a revocation scope is
|
|
39
|
+
* announced — and the session sweep writes no row at all. The handler's own
|
|
40
|
+
* close is the one the revocation owns, so the closer it holds must reach every transport
|
|
41
|
+
* whose connections outlive their credential. `RealtimeCloser` is
|
|
40
42
|
* that fan-out, and `create_app_backend` puts one on `AppDeps`.
|
|
41
43
|
*
|
|
42
44
|
* ## The audit listener
|
|
@@ -69,7 +69,7 @@ export interface CreateFrontendRpcClientOptions<TApi extends object = object> {
|
|
|
69
69
|
* cannot constrain runtime membership, so consumers must keep this list
|
|
70
70
|
* in sync with the typed surface (codegen recommended).
|
|
71
71
|
*
|
|
72
|
-
* Protocol actions (`heartbeat`, `cancel`) are **not** auto-spread —
|
|
72
|
+
* Protocol actions (`heartbeat`, `cancel`, `peer/ping`) are **not** auto-spread —
|
|
73
73
|
* they're filtered out of generated `action_specs` by codegen's
|
|
74
74
|
* `include_protocol_actions: false` default and consumers spread them
|
|
75
75
|
* in explicitly so the contract stays visible at every registration
|
|
@@ -63,7 +63,7 @@ import type { Hono } from 'hono';
|
|
|
63
63
|
import type { UpgradeWebSocket } from 'hono/ws';
|
|
64
64
|
import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.ts';
|
|
65
65
|
import type { RoleName } from '../auth/role_schema.js';
|
|
66
|
-
import type { EffectErrorContext } from '../http/pending_effects.js';
|
|
66
|
+
import type { EffectErrorContext, RequestTracker } from '../http/pending_effects.js';
|
|
67
67
|
import type { RateLimiter } from '../rate_limiter.js';
|
|
68
68
|
import type { NotificationSender } from './notification_sender.js';
|
|
69
69
|
import type { Db } from '../db/db.js';
|
|
@@ -273,6 +273,19 @@ export interface RegisterActionWsOptions {
|
|
|
273
273
|
* The context carries `transport: 'ws'`, the action method, and `path`.
|
|
274
274
|
*/
|
|
275
275
|
on_effect_error?: (error: unknown, context: EffectErrorContext) => void;
|
|
276
|
+
/**
|
|
277
|
+
* Where each message accepted for dispatch is held, from acceptance until
|
|
278
|
+
* its handler has returned and its effect flush — run after the reply is
|
|
279
|
+
* sent, so nothing else holds it — has settled. `create_app_server` passes
|
|
280
|
+
* its view of `deps.request_tracker` (`create_request_tracker_view`), which
|
|
281
|
+
* its HTTP requests share, so `AppServer.close` waits for a message as it
|
|
282
|
+
* does a request. A message the tracker refuses (once closed) is answered
|
|
283
|
+
* `service_unavailable` (`WS_SHUTTING_DOWN_MESSAGE`) and never dispatched.
|
|
284
|
+
* Required, so it can't be forgotten: a hand mount passes
|
|
285
|
+
* `deps.request_tracker` (or one it drains before closing the database), or
|
|
286
|
+
* `null` when it owns its shutdown otherwise (a test harness).
|
|
287
|
+
*/
|
|
288
|
+
request_tracker: RequestTracker | null;
|
|
276
289
|
}
|
|
277
290
|
/** Result of `register_action_ws`. */
|
|
278
291
|
export interface RegisterActionWsResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register_action_ws.d.ts","sourceRoot":"","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;OAQG;IACH,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3C;;;;;;OAMG;IACH,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD;;;;;;;;;;;OAWG;IACH,mBAAmB,EAAE,kBAAkB,CAAC;IACxC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACxE;;;;;;;;;;;OAWG;IACH,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC;AAED,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACtC,wEAAwE;IACxE,QAAQ,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,uBAAuB,KAAG,sBAyLrE,CAAC"}
|
|
@@ -153,7 +153,7 @@ export const register_action_ws = (options) => {
|
|
|
153
153
|
throw new Error(`register_action_ws: outbound_queue_bytes configures the registry created for ${options.path}, ` +
|
|
154
154
|
'but a registry was supplied — set the budget on that ConnectionRegistry instead');
|
|
155
155
|
}
|
|
156
|
-
const { path, app, upgradeWebSocket, actions, db, receive_timeout = DEFAULT_WS_RECEIVE_TIMEOUT, allowed_origins, max_message_bytes = DEFAULT_WS_MAX_MESSAGE_BYTES, log = new Logger('[ws]'), on_socket_open, on_socket_close, action_ip_rate_limiter, action_account_rate_limiter, notification_sender, on_effect_error, required_roles = [] } = options;
|
|
156
|
+
const { path, app, upgradeWebSocket, actions, db, receive_timeout = DEFAULT_WS_RECEIVE_TIMEOUT, allowed_origins, max_message_bytes = DEFAULT_WS_MAX_MESSAGE_BYTES, log = new Logger('[ws]'), on_socket_open, on_socket_close, action_ip_rate_limiter, action_account_rate_limiter, notification_sender, on_effect_error, request_tracker, required_roles = [] } = options;
|
|
157
157
|
const registry = options.registry ??
|
|
158
158
|
new ConnectionRegistry({
|
|
159
159
|
max_connections_per_account: options.max_connections_per_account,
|
|
@@ -204,6 +204,7 @@ export const register_action_ws = (options) => {
|
|
|
204
204
|
action_account_rate_limiter,
|
|
205
205
|
notification_sender,
|
|
206
206
|
on_effect_error,
|
|
207
|
+
request_tracker,
|
|
207
208
|
required_roles
|
|
208
209
|
};
|
|
209
210
|
app.get(path, verify_request_source(allowed_origins), ...pre_authorization, async (c, next) => {
|
|
@@ -113,7 +113,7 @@ import type { Uuid } from '../primitive_schemas.js';
|
|
|
113
113
|
import type { RequestContext } from '../auth/request_context.js';
|
|
114
114
|
import type { RoleName } from '../auth/role_schema.js';
|
|
115
115
|
import { type ResolvedAuth } from '../auth/resolved_auth.js';
|
|
116
|
-
import { type EffectErrorContext } from '../http/pending_effects.js';
|
|
116
|
+
import { type EffectErrorContext, type RequestTracker } from '../http/pending_effects.js';
|
|
117
117
|
import type { RateLimiter } from '../rate_limiter.js';
|
|
118
118
|
import type { NotificationSender } from './notification_sender.js';
|
|
119
119
|
import type { Db } from '../db/db.js';
|
|
@@ -173,6 +173,12 @@ export declare const PRE_ADMISSION_QUEUE_BYTES_FACTOR = 4;
|
|
|
173
173
|
* replies to server-initiated requests, and refused frames never count.
|
|
174
174
|
*/
|
|
175
175
|
export declare const MAX_INBOUND_DISPATCHES_PER_CONNECTION = 128;
|
|
176
|
+
/**
|
|
177
|
+
* The `service_unavailable` message a request gets once the server's shutdown
|
|
178
|
+
* drain has started — its `RequestTracker` closed. TS only: the Rust spine
|
|
179
|
+
* drops a WS message's dispatch with its socket loop at shutdown.
|
|
180
|
+
*/
|
|
181
|
+
export declare const WS_SHUTTING_DOWN_MESSAGE = "server shutting down";
|
|
176
182
|
/**
|
|
177
183
|
* The `queue_overflow` message a request gets past
|
|
178
184
|
* `MAX_INBOUND_DISPATCHES_PER_CONNECTION`. Same text as the Rust spine's.
|
|
@@ -284,6 +290,8 @@ export interface WsSocketEndpoint {
|
|
|
284
290
|
notification_sender: NotificationSender;
|
|
285
291
|
/** Called when an eager pending effect of a frame's action rejects; `undefined` for none. */
|
|
286
292
|
on_effect_error: ((error: unknown, context: EffectErrorContext) => void) | undefined;
|
|
293
|
+
/** Where each message accepted for dispatch is held until its flush settles; `null` for nowhere. */
|
|
294
|
+
request_tracker: RequestTracker | null;
|
|
287
295
|
/** Roles the endpoint's upgrade is gated on; empty for an ungated endpoint. */
|
|
288
296
|
required_roles: ReadonlyArray<RoleName>;
|
|
289
297
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_socket_session.d.ts","sourceRoot":"","sources":["../../src/lib/actions/ws_socket_session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"ws_socket_session.d.ts","sourceRoot":"","sources":["../../src/lib/actions/ws_socket_session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,S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C3C,2EAA2E;IAC3E,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD,oEAAoE;IACpE,mBAAmB,EAAE,kBAAkB,CAAC;IACxC,6FAA6F;IAC7F,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACrF,oGAAoG;IACpG,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,+EAA+E;IAC/E,cAAc,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC/B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,cAAc,EAAE;QAAE,eAAe,EAAE,cAAc,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IACvE;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,gGAAgG;IAChG,eAAe,EAAE,cAAc,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,UAAU,gBAAgB,EAC1B,SAAS,eAAe,KACtB,QAmqBF,CAAC"}
|
|
@@ -173,6 +173,12 @@ export const PRE_ADMISSION_QUEUE_BYTES_FACTOR = 4;
|
|
|
173
173
|
* replies to server-initiated requests, and refused frames never count.
|
|
174
174
|
*/
|
|
175
175
|
export const MAX_INBOUND_DISPATCHES_PER_CONNECTION = 128;
|
|
176
|
+
/**
|
|
177
|
+
* The `service_unavailable` message a request gets once the server's shutdown
|
|
178
|
+
* drain has started — its `RequestTracker` closed. TS only: the Rust spine
|
|
179
|
+
* drops a WS message's dispatch with its socket loop at shutdown.
|
|
180
|
+
*/
|
|
181
|
+
export const WS_SHUTTING_DOWN_MESSAGE = 'server shutting down';
|
|
176
182
|
/**
|
|
177
183
|
* The `queue_overflow` message a request gets past
|
|
178
184
|
* `MAX_INBOUND_DISPATCHES_PER_CONNECTION`. Same text as the Rust spine's.
|
|
@@ -204,7 +210,7 @@ const send_error_response = (registry, connection_id, id, error) => {
|
|
|
204
210
|
* @internal
|
|
205
211
|
*/
|
|
206
212
|
export const create_ws_socket_events = (endpoint, upgrade) => {
|
|
207
|
-
const { path, db, log, registry, action_map, receive_timeout, receive_tick_interval, max_message_bytes, pre_admission_queue_max_bytes, on_socket_open, on_socket_close, action_ip_rate_limiter, action_account_rate_limiter, notification_sender, on_effect_error, required_roles } = endpoint;
|
|
213
|
+
const { path, db, log, registry, action_map, receive_timeout, receive_tick_interval, max_message_bytes, pre_admission_queue_max_bytes, on_socket_open, on_socket_close, action_ip_rate_limiter, action_account_rate_limiter, notification_sender, on_effect_error, request_tracker, required_roles } = endpoint;
|
|
208
214
|
const { client_ip, upgrade_preset, resolved, upgrade_context } = upgrade;
|
|
209
215
|
// the request context's account — `register_action_ws` holds it to the
|
|
210
216
|
// credential's before the upgrade
|
|
@@ -588,16 +594,6 @@ export const create_ws_socket_events = (endpoint, upgrade) => {
|
|
|
588
594
|
send_error(id, jsonrpc_error_messages.method_not_found(method));
|
|
589
595
|
return;
|
|
590
596
|
}
|
|
591
|
-
// Per-request controller — fires on explicit `cancel` or when the
|
|
592
|
-
// socket ends (via the socket_abort_controller chain below).
|
|
593
|
-
// Registered before dispatch, so the request is live (counted, and
|
|
594
|
-
// its id taken) from the moment it is accepted — so a cancel
|
|
595
|
-
// arriving mid-handler finds it;
|
|
596
|
-
// cleared in `finally` so late cancels for a completed id (or a
|
|
597
|
-
// future request that reuses the id) can't null-abort the wrong
|
|
598
|
-
// handler.
|
|
599
|
-
const request_controller = new AbortController();
|
|
600
|
-
pending_controllers.set(id, request_controller);
|
|
601
597
|
// Per-message side-effect queues. `pending_effects` collects
|
|
602
598
|
// eager fire-and-forget pool writes (audit emits, etc.);
|
|
603
599
|
// `post_commit_effects` collects deferred thunks pushed
|
|
@@ -625,13 +621,37 @@ export const create_ws_socket_events = (endpoint, upgrade) => {
|
|
|
625
621
|
// a reply.
|
|
626
622
|
const pending_effects = [];
|
|
627
623
|
const post_commit_effects = [];
|
|
628
|
-
|
|
629
|
-
//
|
|
630
|
-
//
|
|
631
|
-
//
|
|
632
|
-
|
|
633
|
-
|
|
624
|
+
// Accepted for dispatch: held from here until the handler has returned
|
|
625
|
+
// and the flush below has settled, so a shutdown that starts while the
|
|
626
|
+
// handler runs waits for both. The `try` opens at once, so nothing can
|
|
627
|
+
// throw between and leak a held request. A shutdown closes the socket, which
|
|
628
|
+
// aborts `signal`; a handler that runs on regardless is still waited
|
|
629
|
+
// for, and its reply is refused by the closed connection. Once the
|
|
630
|
+
// shutdown drains, the tracker refuses — shed like the in-flight
|
|
631
|
+
// ceiling, never dispatched against a closing database. Reachable only
|
|
632
|
+
// on a socket the close-all didn't end (a hand mount).
|
|
633
|
+
const accepted = request_tracker ? request_tracker.accept() : undefined;
|
|
634
|
+
if (accepted === null) {
|
|
635
|
+
send_error(id, jsonrpc_error_messages.service_unavailable(WS_SHUTTING_DOWN_MESSAGE));
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
634
638
|
try {
|
|
639
|
+
// Per-request controller — fires on explicit `cancel` or when the
|
|
640
|
+
// socket ends (via the socket_abort_controller chain below).
|
|
641
|
+
// Registered before dispatch, so the request is live (counted, and
|
|
642
|
+
// its id taken) from the moment it is accepted — so a cancel
|
|
643
|
+
// arriving mid-handler finds it;
|
|
644
|
+
// cleared in `finally` so late cancels for a completed id (or a
|
|
645
|
+
// future request that reuses the id) can't null-abort the wrong
|
|
646
|
+
// handler.
|
|
647
|
+
const request_controller = new AbortController();
|
|
648
|
+
pending_controllers.set(id, request_controller);
|
|
649
|
+
const notify = notify_socket(connection_id);
|
|
650
|
+
// Server→client request seam (ActionPeer) — closes over this
|
|
651
|
+
// socket's connection_id so a handler can initiate a request to
|
|
652
|
+
// the originating client and await the reply.
|
|
653
|
+
const request_client = (request_method, request_params, request_options) => registry.request_connection(connection_id, request_method, request_params, request_options);
|
|
654
|
+
const signal = AbortSignal.any([socket_abort_controller.signal, request_controller.signal]);
|
|
635
655
|
const result = await perform_action({
|
|
636
656
|
action,
|
|
637
657
|
raw_params: params,
|
|
@@ -660,10 +680,14 @@ export const create_ws_socket_events = (endpoint, upgrade) => {
|
|
|
660
680
|
}
|
|
661
681
|
finally {
|
|
662
682
|
pending_controllers.delete(id);
|
|
663
|
-
// deferred first — see the ordering invariant above
|
|
664
|
-
|
|
683
|
+
// deferred first — see the ordering invariant above. Held on the
|
|
684
|
+
// tracker, since the reply is already sent: a shutdown waits for the
|
|
685
|
+
// flush, as it does an HTTP request's.
|
|
686
|
+
const flushed = flush_request_effects(pending_effects, post_commit_effects, log, on_effect_error
|
|
665
687
|
? (reason) => on_effect_error(reason, { transport: 'ws', method, path })
|
|
666
688
|
: undefined);
|
|
689
|
+
accepted?.finish(flushed);
|
|
690
|
+
await flushed;
|
|
667
691
|
}
|
|
668
692
|
};
|
|
669
693
|
return {
|