typescript: add managed subscription lifetimes - #423
Josh Mouch (joshmouch) wants to merge 1 commit into
Conversation
|
Follow-up integration is ready on the fork branch pr/typescript-managed-host-subscriptions at 7ac6302. It preserves one managed lease across real MultiHostClient transport generations, routes replay/snapshot/missing restoration into that lease, and fences stale generation events and results. The full TypeScript suite is 78/78; focused host and reconnect suites are green. I kept it out of this PR so the shared subscription lifetime can be reviewed independently. The coordinated VS Code consumer and deletion proposal is microsoft/vscode#332854. |
This comment was marked as spam.
This comment was marked as spam.
5c577c6 to
2e14524
Compare
2e14524 to
5a47ef1
Compare
|
Connor Peet (@connor4312) Dmitriy Vasyura (@dmitrivMS) Could you take another look at this TypeScript client PR? Connor’s requested Dmitri, I’m including you because you reviewed the original TypeScript client in #148. If the approach and current changes look good to you, an approving review would help move this forward; otherwise, please flag what you’d like changed. |
Summary
Add a framework-neutral ManagedSubscriptionManager to the official TypeScript client entry point. It provides reusable ownership and lifecycle semantics above the existing subscribe and unsubscribe wire methods without adding protocol vocabulary.
The manager owns:
It deliberately does not import VS Code Event, observable, URI, Disposable, DI, or workbench abstractions. Reducer-backed state, optimistic action reconciliation, and multi-host reconnect restoration remain separate SDK decisions.
Why this belongs in the SDK
Subscriptions are already an AHP protocol concept, and the official client already owns the wire subscription plus state-mirror primitives. Reference ownership, initial-roundtrip delivery, deterministic reacquisition, and final unsubscribe are generic client lifecycle rules; leaving them to each product produces multiple subscription managers above the same SDK.
Validation
The implementation is stateless when a subscription returns no snapshot, so it also supports notification-only resources.