@hydranium/client-theia 1.0.0-next.23 → 1.0.0-next.232
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 +54 -16
- package/lib/browser/browser-capture.js.map +1 -1
- package/lib/browser/channel-logger.d.ts +4 -3
- package/lib/browser/channel-logger.d.ts.map +1 -1
- package/lib/browser/channel-logger.js +10 -7
- package/lib/browser/channel-logger.js.map +1 -1
- package/lib/browser/connection-diagnostics-contribution.d.ts +69 -0
- package/lib/browser/connection-diagnostics-contribution.d.ts.map +1 -0
- package/lib/browser/connection-diagnostics-contribution.js +153 -0
- package/lib/browser/connection-diagnostics-contribution.js.map +1 -0
- package/lib/browser/connection-reporter.d.ts +57 -0
- package/lib/browser/connection-reporter.d.ts.map +1 -0
- package/lib/browser/connection-reporter.js +104 -0
- package/lib/browser/connection-reporter.js.map +1 -0
- package/lib/browser/editor-disk-sync.d.ts +142 -0
- package/lib/browser/editor-disk-sync.d.ts.map +1 -0
- package/lib/browser/editor-disk-sync.js +250 -0
- package/lib/browser/editor-disk-sync.js.map +1 -0
- package/lib/browser/hydranium-file-service.d.ts +44 -0
- package/lib/browser/hydranium-file-service.d.ts.map +1 -0
- package/lib/browser/hydranium-file-service.js +61 -0
- package/lib/browser/hydranium-file-service.js.map +1 -0
- package/lib/browser/index.d.ts +5 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +5 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/log-level-preference.d.ts.map +1 -1
- package/lib/browser/log-level-preference.js +11 -0
- package/lib/browser/log-level-preference.js.map +1 -1
- package/lib/browser/memory-diagnostics-contribution.d.ts +40 -4
- package/lib/browser/memory-diagnostics-contribution.d.ts.map +1 -1
- package/lib/browser/memory-diagnostics-contribution.js +161 -31
- package/lib/browser/memory-diagnostics-contribution.js.map +1 -1
- package/lib/browser/session-aware-connection-source.d.ts +101 -0
- package/lib/browser/session-aware-connection-source.d.ts.map +1 -0
- package/lib/browser/session-aware-connection-source.js +184 -0
- package/lib/browser/session-aware-connection-source.js.map +1 -0
- package/lib/common/clock.d.ts +19 -0
- package/lib/common/clock.d.ts.map +1 -0
- package/lib/common/clock.js +13 -0
- package/lib/common/clock.js.map +1 -0
- package/lib/common/connection-resilience-options.d.ts +30 -0
- package/lib/common/connection-resilience-options.d.ts.map +1 -0
- package/lib/common/connection-resilience-options.js +11 -0
- package/lib/common/connection-resilience-options.js.map +1 -0
- package/lib/common/framed-socket-write-buffer.d.ts +173 -0
- package/lib/common/framed-socket-write-buffer.d.ts.map +1 -0
- package/lib/common/framed-socket-write-buffer.js +293 -0
- package/lib/common/framed-socket-write-buffer.js.map +1 -0
- package/lib/common/inbound-message-sequence.d.ts +56 -0
- package/lib/common/inbound-message-sequence.d.ts.map +1 -0
- package/lib/common/inbound-message-sequence.js +98 -0
- package/lib/common/inbound-message-sequence.js.map +1 -0
- package/lib/common/index.d.ts +13 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +32 -0
- package/lib/common/index.js.map +1 -0
- package/lib/node/abstract-socket-forwarding-connection-handler.d.ts +12 -8
- package/lib/node/abstract-socket-forwarding-connection-handler.d.ts.map +1 -1
- package/lib/node/abstract-socket-forwarding-connection-handler.js +70 -13
- package/lib/node/abstract-socket-forwarding-connection-handler.js.map +1 -1
- package/lib/node/index.d.ts +2 -0
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +2 -0
- package/lib/node/index.js.map +1 -1
- package/lib/node/session-bound-frontend-connection-service.d.ts +118 -0
- package/lib/node/session-bound-frontend-connection-service.d.ts.map +1 -0
- package/lib/node/session-bound-frontend-connection-service.js +224 -0
- package/lib/node/session-bound-frontend-connection-service.js.map +1 -0
- package/lib/node/socket-channel-forwarder.d.ts +54 -0
- package/lib/node/socket-channel-forwarder.d.ts.map +1 -0
- package/lib/node/socket-channel-forwarder.js +95 -0
- package/lib/node/socket-channel-forwarder.js.map +1 -0
- package/lib/testing/stub-inversify-context.js.map +1 -1
- package/lib/testing/stub-output-channel.js.map +1 -1
- package/package.json +31 -32
- package/src/browser/channel-logger.ts +10 -7
- package/src/browser/connection-diagnostics-contribution.ts +142 -0
- package/src/browser/connection-reporter.ts +121 -0
- package/src/browser/editor-disk-sync.ts +253 -0
- package/src/browser/hydranium-file-service.ts +56 -0
- package/src/browser/index.ts +5 -0
- package/src/browser/log-level-preference.ts +11 -0
- package/src/browser/memory-diagnostics-contribution.ts +268 -45
- package/src/browser/session-aware-connection-source.ts +196 -0
- package/src/common/clock.ts +20 -0
- package/src/common/connection-resilience-options.ts +30 -0
- package/src/common/framed-socket-write-buffer.ts +345 -0
- package/src/common/inbound-message-sequence.ts +102 -0
- package/src/common/index.ts +16 -0
- package/src/node/abstract-socket-forwarding-connection-handler.ts +61 -15
- package/src/node/index.ts +2 -0
- package/src/node/session-bound-frontend-connection-service.ts +260 -0
- package/src/node/socket-channel-forwarder.ts +101 -0
package/README.md
CHANGED
|
@@ -18,6 +18,12 @@ hydranium server; a non-Theia host does not need it.
|
|
|
18
18
|
sides of the conversation read as one transcript. The same call also binds
|
|
19
19
|
`ChannelTracer`, the `Tracer` token frontend services inject when they time
|
|
20
20
|
something.
|
|
21
|
+
- **`ConnectionReporter`** with `bindConnectionReporter` — the slot every head
|
|
22
|
+
reports its connection attempts through, reconnects included.
|
|
23
|
+
`DefaultConnectionReporter` shows a progress notification for an attempt still
|
|
24
|
+
running after 3 s and ends it in at most one notification, raising a failure
|
|
25
|
+
once until the head connects again. Rebind the slot to report differently, or
|
|
26
|
+
not at all; the heads keep their retries either way.
|
|
21
27
|
- **`LogLevelPreferenceContribution`** with `bindLogLevelPreference` — applies the
|
|
22
28
|
framework log threshold from a Theia preference once per application, and keeps
|
|
23
29
|
it in sync on change. It is a `FrontendApplicationContribution` on purpose: the
|
|
@@ -32,6 +38,22 @@ hydranium server; a non-Theia host does not need it.
|
|
|
32
38
|
(Backend) — register only when the optional `HostMemoryDiagnosticsService` is
|
|
33
39
|
bound. You bind `MemoryDiagnosticsService` to your own connected data-server
|
|
34
40
|
frontend; the framework cannot, because that class is yours.
|
|
41
|
+
- **`EditorDiskSync`** — keeps a dirty editor's save from applying edits its
|
|
42
|
+
file already holds, as the file does once the server saves a document the
|
|
43
|
+
editor shows unsaved. Before each save of the editor it drops the edits the
|
|
44
|
+
file holds, so the save writes only the rest, a save participant's included;
|
|
45
|
+
on each watched change of the file to the editor's text it marks the editor
|
|
46
|
+
clean. Theia otherwise keeps the editor dirty, and its next save applies the
|
|
47
|
+
editor's edits to a file that already holds them.
|
|
48
|
+
`bindEditorDiskSync(bind, isBound, rebind)` binds it, with
|
|
49
|
+
`HydraniumFileService`.
|
|
50
|
+
- **`HydraniumFileService`** — Theia's `FileService`, refusing an editor's
|
|
51
|
+
incremental save once the file's mtime has moved past the one the editor
|
|
52
|
+
read, so the editor writes its whole text instead. Theia's own check passes a
|
|
53
|
+
file of unchanged size, and the save then applies the editor's edits to a
|
|
54
|
+
file that may already hold them; `write` keeps Theia's check. The safety net
|
|
55
|
+
behind `EditorDiskSync`, for a save the sync cannot catch, and bound with it
|
|
56
|
+
by `bindEditorDiskSync`.
|
|
35
57
|
- **`captureBrowserRuntime` / `formatBrowserRuntime`** — the renderer's own memory
|
|
36
58
|
reading as a `BrowserRuntimeReport`, preferring the standardized
|
|
37
59
|
`performance.measureUserAgentSpecificMemory()` and falling back to Chromium's
|
|
@@ -43,6 +65,14 @@ hydranium server; a non-Theia host does not need it.
|
|
|
43
65
|
forwarder bridges the two; port discovery, connect orchestration, and the
|
|
44
66
|
buffer-and-replay fix for frontend writes that arrive before the forwarder is
|
|
45
67
|
wired all live here.
|
|
68
|
+
- **`SocketChannelForwarder`** (Node side) — the byte forwarder both heads plug
|
|
69
|
+
into that hook. When the frontend channel closes, it finishes the writes it
|
|
70
|
+
still has queued before it ends the socket, so a message sent just before a
|
|
71
|
+
page goes away still reaches the server.
|
|
72
|
+
- **`Clock`** (either side) — the protocol's `Clock` as an injection token.
|
|
73
|
+
The frontend and backend classes above that time or bound something inject
|
|
74
|
+
it as optional and use a `SystemClock` when the container binds none, so a
|
|
75
|
+
container can supply another clock.
|
|
46
76
|
- **`./testing`** — `makeStubOutputChannelManager` and `makeStubInversifyContext`,
|
|
47
77
|
the doubles that let the pieces above be unit-tested without a Theia
|
|
48
78
|
application.
|
|
@@ -60,8 +90,11 @@ declared peer dependencies are:
|
|
|
60
90
|
| --------------------- | ------------- |
|
|
61
91
|
| `@hydranium/protocol` | `^1.0.0-next` |
|
|
62
92
|
| `@theia/core` | `^1.70.0` |
|
|
93
|
+
| `@theia/editor` | `^1.70.0` |
|
|
94
|
+
| `@theia/filesystem` | `^1.70.0` |
|
|
63
95
|
| `@theia/output` | `^1.70.0` |
|
|
64
96
|
| `inversify` | `^6.0.0` |
|
|
97
|
+
| `vscode-jsonrpc` | `^9.0.0` |
|
|
65
98
|
|
|
66
99
|
`@theia/output` is easy to miss: the memory-diagnostics commands and the channel
|
|
67
100
|
logger both write to an Output channel, so a host that does not already depend on
|
|
@@ -76,7 +109,8 @@ from here:
|
|
|
76
109
|
|
|
77
110
|
- a **frontend** module (a `ContainerModule` in the extension's `browser/` tier)
|
|
78
111
|
calls the `bind*` helpers — `bindChannelLogger`, `bindLogLevelPreference`,
|
|
79
|
-
`bindMemoryDiagnostics
|
|
112
|
+
`bindMemoryDiagnostics`, and `bindEditorDiskSync` whenever a server writes
|
|
113
|
+
files an editor can have open — and binds `MemoryDiagnosticsService` to your
|
|
80
114
|
data-server frontend;
|
|
81
115
|
- a **backend** module (the extension's `node/` tier) registers a
|
|
82
116
|
`AbstractSocketForwardingConnectionHandler` subclass as a Theia `ConnectionHandler`. In
|
|
@@ -86,25 +120,29 @@ from here:
|
|
|
86
120
|
|
|
87
121
|
## Entry points
|
|
88
122
|
|
|
89
|
-
| Subpath | Holds
|
|
90
|
-
| ----------- |
|
|
91
|
-
| `.` | Nothing. Deliberately empty, so an environment-specific import cannot reach the wrong bundle through a barrel.
|
|
92
|
-
| `./browser` | `ChannelLogger`, `ChannelTracer`, `LogLevelPreferenceContribution`, `MemoryDiagnosticsContribution`, the `bind*` helpers, `captureBrowserRuntime`
|
|
93
|
-
| `./
|
|
94
|
-
| `./
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
123
|
+
| Subpath | Holds | Environment |
|
|
124
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
125
|
+
| `.` | Nothing. Deliberately empty, so an environment-specific import cannot reach the wrong bundle through a barrel. | browser-neutral (gated) |
|
|
126
|
+
| `./browser` | `ChannelLogger`, `ChannelTracer`, `ConnectionReporter`, `DefaultConnectionReporter`, `LogLevelPreferenceContribution`, `MemoryDiagnosticsContribution`, `EditorDiskSync`, `HydraniumFileService`, the `bind*` helpers, `captureBrowserRuntime` | browser / Theia frontend (gated) |
|
|
127
|
+
| `./common` | `Clock`, the framed socket write buffer and the connection-resilience options | browser-neutral (gated) |
|
|
128
|
+
| `./node` | `AbstractSocketForwardingConnectionHandler` and its options, `SocketChannelForwarder` — imports `node:net` | Node / Theia backend |
|
|
129
|
+
| `./testing` | `makeStubOutputChannelManager`, `makeStubInversifyContext` | browser-neutral (gated) |
|
|
130
|
+
|
|
131
|
+
Resolve the subpaths with [a resolver that reads
|
|
132
|
+
`exports`](../../docs/adopting/requirements.md#a-resolver-that-reads-exports);
|
|
133
|
+
`"Node"` (node10) reaches none of them. "Gated" means the
|
|
134
|
+
entry is enforced browser-neutral by the repository's neutral-bundle check: it
|
|
135
|
+
must bundle for the browser with no `node:*` import, including transitive ones —
|
|
136
|
+
and [what "gated neutral" does and does not promise](../../docs/concepts/browser-hosting.md#a-note-on-what-gated-neutral-does-and-does-not-promise).
|
|
100
137
|
`./node` is deliberately not gated — that tier is where Node-only code belongs.
|
|
101
138
|
|
|
102
139
|
## Status
|
|
103
140
|
|
|
104
|
-
Alpha — pre-v0,
|
|
105
|
-
deprecation cycle. See
|
|
106
|
-
|
|
107
|
-
|
|
141
|
+
Alpha — pre-v0, published as a `1.0.0-next` prerelease on every merge to `main`.
|
|
142
|
+
The API is not stable and may change without a deprecation cycle. See
|
|
143
|
+
[`docs/concepts/architecture.md`](../../docs/concepts/architecture.md) for how
|
|
144
|
+
the Theia client tier relates to the heads, and the [repository
|
|
145
|
+
README](../../README.md) for current status and known limitations.
|
|
108
146
|
|
|
109
147
|
## License
|
|
110
148
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-capture.js","sourceRoot":"","sources":["../../src/browser/browser-capture.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"browser-capture.js","sourceRoot":"","sources":["../../src/browser/browser-capture.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;AAmBlF;;;;;;;GAOG;AACI,KAAK;IACT,MAAM,IAAI,GAAG,UAAU,CAAC,WAAmE,CAAC;IAC5F,IAAI,IAAI,EAAE,8BAA8B,EAAE,CAAC;QACxC,IAAI,CAAC;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,8BAA8B,EAAE,CAAC;YAC3D,OAAO,EAAE,MAAM,EAAE,gCAAgC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QACzH,CAAC;QAAC,MAAM,CAAC;YACN,qEAAqE;QACxE,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO;YACJ,MAAM,EAAE,oBAAoB;YAC5B,KAAK,EAAE;gBACJ,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc;gBAC3C,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe;gBAC7C,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe;aAC/C;SACH,CAAC;IACL,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,EAAE,CAAC,KAAa;IACtB,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACrD,CAAC;AAED,yFAAyF;AACzF,8BAAqC,MAA4B;IAC9D,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACzB,IAAI,MAAM,CAAC,MAAM,KAAK,gCAAgC,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACxF,OAAO,sCAAsC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,+BAA+B,CAAC;IACpG,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,oBAAoB,IAAI,KAAK,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACjF,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAC;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,IAAI,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,IAAI,CAAC,CAAC;QAC1C,OAAO,oBAAoB,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,+CAA+C,CAAC;IAC/H,CAAC;IACD,OAAO,8GAA8G,CAAC;AACzH,CAAC"}
|
|
@@ -61,9 +61,10 @@ export declare class ChannelLogger extends AbstractLogger {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Inversify token for the browser `Tracer` — a {@link DefaultTracer} over
|
|
64
|
-
* the {@link ChannelLogger} (emit sink) +
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* the {@link ChannelLogger} (emit sink) + the container's {@link Clock}, or a
|
|
65
|
+
* `SystemClock` when it binds none, + a browser heap reader. The browser head
|
|
66
|
+
* has no Langium `services.Tracer` slot, so this is how frontend services that
|
|
67
|
+
* time obtain a tracer: `@inject(ChannelTracer)`.
|
|
67
68
|
* Bound by {@link bindChannelLogger}.
|
|
68
69
|
*/
|
|
69
70
|
export declare const ChannelTracer: unique symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-logger.d.ts","sourceRoot":"","sources":["../../src/browser/channel-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAiB,KAAK,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AACnH,OAAO,EAAc,KAAK,UAAU,EAAqB,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,KAAK,aAAa,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"channel-logger.d.ts","sourceRoot":"","sources":["../../src/browser/channel-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAiB,KAAK,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AACnH,OAAO,EAAc,KAAK,UAAU,EAAqB,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,KAAK,aAAa,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGpG;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;sFACsF;AACtF,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,aAAc,SAAQ,cAAc;IAIb,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,oBAAoB;IACvD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,oBAAoB;IAJjF,SAAS,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEnC,YACoD,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,oBAAoB,EACjE,SAAS,GAAE,MAAM,GAAG,SAA6B,EAGhE;IAED,SAAS,KAAK,OAAO,IAAI,aAAa,CAErC;IAED,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAG/F;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOxC;CACH;AAOD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,eAA0B,CAAC;AAErD;gDACgD;AAChD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,GAAG,MAAM,GAAG,SAAS,CAOpF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAc5F"}
|
|
@@ -26,6 +26,7 @@ exports.bindChannelLogger = bindChannelLogger;
|
|
|
26
26
|
const protocol_1 = require("@hydranium/protocol");
|
|
27
27
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
28
28
|
const output_channel_1 = require("@theia/output/lib/browser/output-channel");
|
|
29
|
+
const clock_1 = require("../common/clock");
|
|
29
30
|
/** Inversify token for the {@link ChannelLoggerOptions} constant (merged with the
|
|
30
31
|
* interface name — the standard Theia "type + token under one identifier" idiom). */
|
|
31
32
|
exports.ChannelLoggerOptions = Symbol('ChannelLoggerOptions');
|
|
@@ -59,10 +60,8 @@ let ChannelLogger = class ChannelLogger extends protocol_1.AbstractLogger {
|
|
|
59
60
|
return (this._channel ??= this.outputChannels.getChannel(this.options.channelName));
|
|
60
61
|
}
|
|
61
62
|
emit(_level, label, message, args) {
|
|
62
|
-
const componentSegment = this.component ? ` [${this.component}]` : '';
|
|
63
63
|
const formattedArgs = args.length > 0 ? ' ' + args.map(stringifyArg).join(' ') : '';
|
|
64
|
-
|
|
65
|
-
this.channel.appendLine(`[${label.padEnd(5)} - ${this.timestamp()}]${componentSegment} ${message}${formattedArgs}`);
|
|
64
|
+
this.channel.appendLine(`${this.formatLinePrefix(label)} ${message}${formattedArgs}`);
|
|
66
65
|
}
|
|
67
66
|
/**
|
|
68
67
|
* Allocates a free instance bypassing Inversify, so a derived logger inherits
|
|
@@ -89,9 +88,10 @@ exports.ChannelLogger = ChannelLogger = __decorate([
|
|
|
89
88
|
const ChannelLoggerBase = Symbol('ChannelLoggerBase');
|
|
90
89
|
/**
|
|
91
90
|
* Inversify token for the browser `Tracer` — a {@link DefaultTracer} over
|
|
92
|
-
* the {@link ChannelLogger} (emit sink) +
|
|
93
|
-
*
|
|
94
|
-
*
|
|
91
|
+
* the {@link ChannelLogger} (emit sink) + the container's {@link Clock}, or a
|
|
92
|
+
* `SystemClock` when it binds none, + a browser heap reader. The browser head
|
|
93
|
+
* has no Langium `services.Tracer` slot, so this is how frontend services that
|
|
94
|
+
* time obtain a tracer: `@inject(ChannelTracer)`.
|
|
95
95
|
* Bound by {@link bindChannelLogger}.
|
|
96
96
|
*/
|
|
97
97
|
exports.ChannelTracer = Symbol('ChannelTracer');
|
|
@@ -127,7 +127,10 @@ function bindChannelLogger(bind, options) {
|
|
|
127
127
|
return parentName ? base.for(parentName) : base;
|
|
128
128
|
});
|
|
129
129
|
bind(exports.ChannelTracer)
|
|
130
|
-
.toDynamicValue(ctx =>
|
|
130
|
+
.toDynamicValue(ctx => {
|
|
131
|
+
const clock = ctx.container.isBound(clock_1.Clock) ? ctx.container.get(clock_1.Clock) : new protocol_1.SystemClock();
|
|
132
|
+
return new protocol_1.DefaultTracer(ctx.container.get(ChannelLoggerBase), clock, readBrowserMemory);
|
|
133
|
+
})
|
|
131
134
|
.inSingletonScope();
|
|
132
135
|
}
|
|
133
136
|
/** Browser heap reader for {@link ChannelTracer}, backed by Chromium's non-standard `performance.memory`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-logger.js","sourceRoot":"","sources":["../../src/browser/channel-logger.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"channel-logger.js","sourceRoot":"","sources":["../../src/browser/channel-logger.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;;AAElF,kDAAmH;AACnH,4DAA8F;AAC9F,6EAAoG;AACpG,2CAAwC;AAkBxC;sFACsF;AACzE,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,yBAAc;IAIM,cAAc;IACd,OAAO;IAJjD,QAAQ,CAAiB;IAEnC,YACoD,cAAoC,EACpC,OAA6B,EACjE,YAAgC,OAAO,CAAC,SAAS;QAE9D,KAAK,CAAC,SAAS,CAAC,CAAC;8BAJgC,cAAc;uBACd,OAAO;IAI3D,CAAC;IAED,IAAc,OAAO;QAClB,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IACvF,CAAC;IAES,IAAI,CAAC,MAAgB,EAAE,KAAa,EAAE,OAAe,EAAE,IAAwB;QACtF,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpF,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,OAAO,GAAG,aAAa,EAAE,CAA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,CAAC;IACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { MessageService } from '@theia/core';
|
|
10
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
|
|
11
|
+
import { ConnectionStatus, ConnectionStatusService } from '@theia/core/lib/browser/connection-status-service';
|
|
12
|
+
import { WebSocketConnectionSource } from '@theia/core/lib/browser/messaging/ws-connection-source';
|
|
13
|
+
import { type interfaces } from '@theia/core/shared/inversify';
|
|
14
|
+
import { type ConnectionBufferOverflow } from '../common/framed-socket-write-buffer';
|
|
15
|
+
import { ChannelLogger } from './channel-logger';
|
|
16
|
+
/**
|
|
17
|
+
* Records the browser side of the websocket lifecycle into the adopter's Output
|
|
18
|
+
* channel, and tells the user the one thing they cannot recover from on their
|
|
19
|
+
* own.
|
|
20
|
+
*
|
|
21
|
+
* Theia reports an outage only as an "Offline" status-bar item, which cannot
|
|
22
|
+
* distinguish a plain network drop from the server having stopped answering on a
|
|
23
|
+
* socket that is still up. The latter is what a connection defect looks like
|
|
24
|
+
* from here, so the two are logged differently — that distinction is what says
|
|
25
|
+
* whether reopening an editor helps or only a reload does.
|
|
26
|
+
*
|
|
27
|
+
* Purely observational apart from the overflow message: nothing here changes how
|
|
28
|
+
* the connection behaves.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ConnectionDiagnosticsContribution implements FrontendApplicationContribution {
|
|
31
|
+
protected readonly connectionSource: WebSocketConnectionSource;
|
|
32
|
+
protected readonly connectionStatus: ConnectionStatusService;
|
|
33
|
+
protected readonly logger: ChannelLogger;
|
|
34
|
+
protected readonly messageService: MessageService;
|
|
35
|
+
/** Main channels created so far; more than one means the server did not recognise this frontend. */
|
|
36
|
+
protected channelCount: number;
|
|
37
|
+
protected socketClosedAt?: number;
|
|
38
|
+
protected offlineAt?: number;
|
|
39
|
+
initialize(): void;
|
|
40
|
+
protected handleSocketOpen(): void;
|
|
41
|
+
protected handleSocketClose(): void;
|
|
42
|
+
/**
|
|
43
|
+
* A second channel means the reconnect was refused and the session discarded.
|
|
44
|
+
* Only reachable with `reloadOnReconnect` off — with it on, Theia reloads the
|
|
45
|
+
* page instead of opening another channel.
|
|
46
|
+
*/
|
|
47
|
+
protected handleChannelOpen(): void;
|
|
48
|
+
protected handleStatusChange(status: ConnectionStatus): void;
|
|
49
|
+
/**
|
|
50
|
+
* The outage outlasted what the buffer can hold, so changes made from here on
|
|
51
|
+
* are being thrown away rather than queued. Reconnecting resumes sending but
|
|
52
|
+
* cannot bring those back, which leaves the editor disagreeing with the
|
|
53
|
+
* server — and without a message the user would see nothing but an editor
|
|
54
|
+
* that has quietly stopped saving, so say it plainly.
|
|
55
|
+
*/
|
|
56
|
+
protected handleBufferOverflow(overflow: ConnectionBufferOverflow): void;
|
|
57
|
+
protected socketId(): string;
|
|
58
|
+
protected statusName(status: ConnectionStatus): string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Bind {@link ConnectionDiagnosticsContribution} as a `FrontendApplicationContribution`.
|
|
62
|
+
*
|
|
63
|
+
* Needs a {@link ChannelLogger} binding, so call it from a module that has also
|
|
64
|
+
* called `bindChannelLogger`. Unlike `bindConnectionResilience` this belongs in a
|
|
65
|
+
* normal frontend module: it only observes, so it has no reason to run during
|
|
66
|
+
* preload, and `MessageService` is not available that early.
|
|
67
|
+
*/
|
|
68
|
+
export declare function bindConnectionDiagnostics(bind: interfaces.Bind): void;
|
|
69
|
+
//# sourceMappingURL=connection-diagnostics-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-diagnostics-contribution.d.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GAAG,IAAI,CAQvE;IAED,SAAS,CAAC,QAAQ,IAAI,MAAM,CAE3B;IAED,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAErD;CACH;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAGrE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.ConnectionDiagnosticsContribution = void 0;
|
|
21
|
+
exports.bindConnectionDiagnostics = bindConnectionDiagnostics;
|
|
22
|
+
const core_1 = require("@theia/core");
|
|
23
|
+
const frontend_application_contribution_1 = require("@theia/core/lib/browser/frontend-application-contribution");
|
|
24
|
+
const connection_status_service_1 = require("@theia/core/lib/browser/connection-status-service");
|
|
25
|
+
const ws_connection_source_1 = require("@theia/core/lib/browser/messaging/ws-connection-source");
|
|
26
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
+
const channel_logger_1 = require("./channel-logger");
|
|
28
|
+
const session_aware_connection_source_1 = require("./session-aware-connection-source");
|
|
29
|
+
/**
|
|
30
|
+
* Records the browser side of the websocket lifecycle into the adopter's Output
|
|
31
|
+
* channel, and tells the user the one thing they cannot recover from on their
|
|
32
|
+
* own.
|
|
33
|
+
*
|
|
34
|
+
* Theia reports an outage only as an "Offline" status-bar item, which cannot
|
|
35
|
+
* distinguish a plain network drop from the server having stopped answering on a
|
|
36
|
+
* socket that is still up. The latter is what a connection defect looks like
|
|
37
|
+
* from here, so the two are logged differently — that distinction is what says
|
|
38
|
+
* whether reopening an editor helps or only a reload does.
|
|
39
|
+
*
|
|
40
|
+
* Purely observational apart from the overflow message: nothing here changes how
|
|
41
|
+
* the connection behaves.
|
|
42
|
+
*/
|
|
43
|
+
let ConnectionDiagnosticsContribution = class ConnectionDiagnosticsContribution {
|
|
44
|
+
connectionSource;
|
|
45
|
+
connectionStatus;
|
|
46
|
+
logger;
|
|
47
|
+
messageService;
|
|
48
|
+
/** Main channels created so far; more than one means the server did not recognise this frontend. */
|
|
49
|
+
channelCount = 0;
|
|
50
|
+
socketClosedAt;
|
|
51
|
+
offlineAt;
|
|
52
|
+
initialize() {
|
|
53
|
+
this.connectionSource.onSocketDidOpen(() => this.handleSocketOpen());
|
|
54
|
+
this.connectionSource.onSocketDidClose(() => this.handleSocketClose());
|
|
55
|
+
this.connectionSource.onConnectionDidOpen(() => this.handleChannelOpen());
|
|
56
|
+
this.connectionStatus.onStatusChange(status => this.handleStatusChange(status));
|
|
57
|
+
if (this.connectionSource instanceof session_aware_connection_source_1.SessionAwareConnectionSource) {
|
|
58
|
+
this.connectionSource.onBufferOverflow(overflow => this.handleBufferOverflow(overflow));
|
|
59
|
+
}
|
|
60
|
+
// The socket is opened by the preloader, before this contribution exists, so the first
|
|
61
|
+
// `onSocketDidOpen` has already fired; state the current situation instead.
|
|
62
|
+
this.logger.info(`diagnostics active; socket ${this.socketId()}, backend ${this.statusName(this.connectionStatus.currentStatus)}`);
|
|
63
|
+
}
|
|
64
|
+
handleSocketOpen() {
|
|
65
|
+
const downFor = this.socketClosedAt === undefined ? '' : ` after ${Date.now() - this.socketClosedAt} ms down`;
|
|
66
|
+
this.socketClosedAt = undefined;
|
|
67
|
+
this.logger.info(`websocket connected: socket ${this.socketId()}${downFor}`);
|
|
68
|
+
}
|
|
69
|
+
handleSocketClose() {
|
|
70
|
+
this.socketClosedAt = Date.now();
|
|
71
|
+
this.logger.info(`websocket disconnected: socket ${this.socketId()}; outgoing messages are buffered until it returns`);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A second channel means the reconnect was refused and the session discarded.
|
|
75
|
+
* Only reachable with `reloadOnReconnect` off — with it on, Theia reloads the
|
|
76
|
+
* page instead of opening another channel.
|
|
77
|
+
*/
|
|
78
|
+
handleChannelOpen() {
|
|
79
|
+
this.channelCount++;
|
|
80
|
+
if (this.channelCount === 1) {
|
|
81
|
+
this.logger.info(`initial channel opened on socket ${this.socketId()}`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.logger.warn(`new channel #${this.channelCount} on socket ${this.socketId()}: the backend did not recognise this frontend, ` +
|
|
85
|
+
'so its session was discarded and every pending request rejected');
|
|
86
|
+
}
|
|
87
|
+
handleStatusChange(status) {
|
|
88
|
+
if (status === connection_status_service_1.ConnectionStatus.ONLINE) {
|
|
89
|
+
const offlineFor = this.offlineAt === undefined ? '' : ` after ${Date.now() - this.offlineAt} ms`;
|
|
90
|
+
this.offlineAt = undefined;
|
|
91
|
+
this.logger.info(`backend reachable again${offlineFor}`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.offlineAt = Date.now();
|
|
95
|
+
const socket = this.connectionSource.socket;
|
|
96
|
+
if (socket?.connected) {
|
|
97
|
+
this.logger.warn(`backend stopped answering while socket ${socket.id} is still connected: nothing this session sends will ` +
|
|
98
|
+
'arrive, and socket.io will not reconnect on its own. Reload the page to recover.');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
this.logger.info(`backend unreachable; websocket is disconnected (socket ${this.socketId()})`);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The outage outlasted what the buffer can hold, so changes made from here on
|
|
105
|
+
* are being thrown away rather than queued. Reconnecting resumes sending but
|
|
106
|
+
* cannot bring those back, which leaves the editor disagreeing with the
|
|
107
|
+
* server — and without a message the user would see nothing but an editor
|
|
108
|
+
* that has quietly stopped saving, so say it plainly.
|
|
109
|
+
*/
|
|
110
|
+
handleBufferOverflow(overflow) {
|
|
111
|
+
this.logger.error(`buffer full at ${overflow.maxBytes} bytes holding ${overflow.messages} message(s)`);
|
|
112
|
+
this.messageService.error(core_1.nls.localize('hydranium/connection/offlineLimitReached', 'Disconnected for too long: recent changes were not sent. Reload the page before continuing.'));
|
|
113
|
+
}
|
|
114
|
+
socketId() {
|
|
115
|
+
return this.connectionSource.socket?.id ?? ws_connection_source_1.WebSocketConnectionSource.NO_CONNECTION;
|
|
116
|
+
}
|
|
117
|
+
statusName(status) {
|
|
118
|
+
return status === connection_status_service_1.ConnectionStatus.ONLINE ? 'online' : 'offline';
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
exports.ConnectionDiagnosticsContribution = ConnectionDiagnosticsContribution;
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, inversify_1.inject)(ws_connection_source_1.WebSocketConnectionSource),
|
|
124
|
+
__metadata("design:type", ws_connection_source_1.WebSocketConnectionSource)
|
|
125
|
+
], ConnectionDiagnosticsContribution.prototype, "connectionSource", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, inversify_1.inject)(connection_status_service_1.ConnectionStatusService),
|
|
128
|
+
__metadata("design:type", Object)
|
|
129
|
+
], ConnectionDiagnosticsContribution.prototype, "connectionStatus", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, inversify_1.inject)(channel_logger_1.ChannelLogger),
|
|
132
|
+
__metadata("design:type", channel_logger_1.ChannelLogger)
|
|
133
|
+
], ConnectionDiagnosticsContribution.prototype, "logger", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, inversify_1.inject)(core_1.MessageService),
|
|
136
|
+
__metadata("design:type", core_1.MessageService)
|
|
137
|
+
], ConnectionDiagnosticsContribution.prototype, "messageService", void 0);
|
|
138
|
+
exports.ConnectionDiagnosticsContribution = ConnectionDiagnosticsContribution = __decorate([
|
|
139
|
+
(0, inversify_1.injectable)()
|
|
140
|
+
], ConnectionDiagnosticsContribution);
|
|
141
|
+
/**
|
|
142
|
+
* Bind {@link ConnectionDiagnosticsContribution} as a `FrontendApplicationContribution`.
|
|
143
|
+
*
|
|
144
|
+
* Needs a {@link ChannelLogger} binding, so call it from a module that has also
|
|
145
|
+
* called `bindChannelLogger`. Unlike `bindConnectionResilience` this belongs in a
|
|
146
|
+
* normal frontend module: it only observes, so it has no reason to run during
|
|
147
|
+
* preload, and `MessageService` is not available that early.
|
|
148
|
+
*/
|
|
149
|
+
function bindConnectionDiagnostics(bind) {
|
|
150
|
+
bind(ConnectionDiagnosticsContribution).toSelf().inSingletonScope();
|
|
151
|
+
bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(ConnectionDiagnosticsContribution);
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=connection-diagnostics-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/connection-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;AAElF,sCAAkD;AAClD,iHAA4G;AAC5G,iGAA8G;AAC9G,iGAAmG;AACnG,4DAAmF;AAEnF,qDAAiD;AACjD,uFAAiF;AAEjF;;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AAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACpE,IAAI,CAAC,mEAA+B,CAAC,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { MessageService, type Progress } from '@theia/core';
|
|
10
|
+
import { type interfaces } from '@theia/core/shared/inversify';
|
|
11
|
+
/** What a head connects to, as the whole sentences reported about it. */
|
|
12
|
+
export interface ConnectionTarget {
|
|
13
|
+
readonly connectingMessage: string;
|
|
14
|
+
readonly connectedMessage: string;
|
|
15
|
+
}
|
|
16
|
+
/** One connection attempt; it reports exactly one end. */
|
|
17
|
+
export interface ConnectionAttempt {
|
|
18
|
+
connected(): void;
|
|
19
|
+
/** Ends the attempt with nothing to report, as when its head is disposed
|
|
20
|
+
* or a newer attempt takes over. */
|
|
21
|
+
cancelled(): void;
|
|
22
|
+
/**
|
|
23
|
+
* `message` is the whole sentence to report. `retry`, when given, starts a
|
|
24
|
+
* fresh attempt at once; a head without one keeps retrying on its own.
|
|
25
|
+
*/
|
|
26
|
+
failed(message: string, retry?: () => void): void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* How a head's connection attempts reach the user. A head calls
|
|
30
|
+
* {@link connecting} for every attempt, a reconnect included, and keeps the
|
|
31
|
+
* attempt's retries and bounds itself; this decides only what is shown. Rebind
|
|
32
|
+
* the slot to show nothing, or something other than notifications.
|
|
33
|
+
*/
|
|
34
|
+
export interface ConnectionReporter {
|
|
35
|
+
connecting(target: ConnectionTarget): ConnectionAttempt;
|
|
36
|
+
}
|
|
37
|
+
export declare const ConnectionReporter: unique symbol;
|
|
38
|
+
/**
|
|
39
|
+
* Reports through Theia notifications: an attempt still running after
|
|
40
|
+
* {@link connectingNoticeDelayMs} shows its progress, and an attempt ends in at
|
|
41
|
+
* most one notification. A failure is shown once per target until it connects
|
|
42
|
+
* again, so a head that keeps retrying does not raise one per attempt.
|
|
43
|
+
*/
|
|
44
|
+
export declare class DefaultConnectionReporter implements ConnectionReporter {
|
|
45
|
+
protected readonly messageService: MessageService;
|
|
46
|
+
protected readonly connectingNoticeDelayMs: number;
|
|
47
|
+
/** Targets whose last reported attempt failed. */
|
|
48
|
+
protected readonly failing: Set<ConnectionTarget>;
|
|
49
|
+
connecting(target: ConnectionTarget): ConnectionAttempt;
|
|
50
|
+
protected showConnecting(target: ConnectionTarget): Promise<Progress>;
|
|
51
|
+
protected showConnected(target: ConnectionTarget): void;
|
|
52
|
+
protected showFailed(target: ConnectionTarget, message: string, retry?: () => void): Promise<void>;
|
|
53
|
+
protected retryLabel(): string;
|
|
54
|
+
}
|
|
55
|
+
/** Bind {@link DefaultConnectionReporter} unless the slot is bound already; every head calls this. */
|
|
56
|
+
export declare function bindConnectionReporter(bind: interfaces.Bind, isBound: interfaces.IsBound): void;
|
|
57
|
+
//# sourceMappingURL=connection-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-reporter.d.ts","sourceRoot":"","sources":["../../src/browser/connection-reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAO,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEnF,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACpC;AAED,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAC/B,SAAS,IAAI,IAAI,CAAC;IAClB;yCACqC;IACrC,SAAS,IAAI,IAAI,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACpD;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAChC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;CAC1D;AACD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D;;;;;GAKG;AACH,qBACa,yBAA0B,YAAW,kBAAkB;IACzC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAG,cAAc,CAAC;IAE3E,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAS;IAC3D,kDAAkD;IAClD,SAAS,CAAC,QAAQ,CAAC,OAAO,wBAA+B;IAEzD,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,CA+BtD;IAED,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEpE;IAED,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAEtD;IAED,UAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAWvG;IAED,SAAS,CAAC,UAAU,IAAI,MAAM,CAE7B;CACH;AAED,sGAAsG;AACtG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,GAAG,IAAI,CAI/F"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.DefaultConnectionReporter = exports.ConnectionReporter = void 0;
|
|
21
|
+
exports.bindConnectionReporter = bindConnectionReporter;
|
|
22
|
+
const core_1 = require("@theia/core");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
exports.ConnectionReporter = Symbol('ConnectionReporter');
|
|
25
|
+
/**
|
|
26
|
+
* Reports through Theia notifications: an attempt still running after
|
|
27
|
+
* {@link connectingNoticeDelayMs} shows its progress, and an attempt ends in at
|
|
28
|
+
* most one notification. A failure is shown once per target until it connects
|
|
29
|
+
* again, so a head that keeps retrying does not raise one per attempt.
|
|
30
|
+
*/
|
|
31
|
+
let DefaultConnectionReporter = class DefaultConnectionReporter {
|
|
32
|
+
messageService;
|
|
33
|
+
connectingNoticeDelayMs = 3_000;
|
|
34
|
+
/** Targets whose last reported attempt failed. */
|
|
35
|
+
failing = new Set();
|
|
36
|
+
connecting(target) {
|
|
37
|
+
let progress;
|
|
38
|
+
const notice = this.failing.has(target)
|
|
39
|
+
? undefined
|
|
40
|
+
: setTimeout(() => (progress = this.showConnecting(target)), this.connectingNoticeDelayMs);
|
|
41
|
+
let settled = false;
|
|
42
|
+
const settle = () => {
|
|
43
|
+
if (settled) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
settled = true;
|
|
47
|
+
clearTimeout(notice);
|
|
48
|
+
void progress?.then(shown => shown.cancel());
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
connected: () => {
|
|
53
|
+
if (settle() && (this.failing.delete(target) || progress)) {
|
|
54
|
+
this.showConnected(target);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
cancelled: () => {
|
|
58
|
+
settle();
|
|
59
|
+
},
|
|
60
|
+
failed: (message, retry) => {
|
|
61
|
+
if (settle() && !this.failing.has(target)) {
|
|
62
|
+
this.failing.add(target);
|
|
63
|
+
void this.showFailed(target, message, retry);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
showConnecting(target) {
|
|
69
|
+
return this.messageService.showProgress({ text: target.connectingMessage });
|
|
70
|
+
}
|
|
71
|
+
showConnected(target) {
|
|
72
|
+
this.messageService.info(target.connectedMessage);
|
|
73
|
+
}
|
|
74
|
+
async showFailed(target, message, retry) {
|
|
75
|
+
if (!retry) {
|
|
76
|
+
this.messageService.error(message);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const label = this.retryLabel();
|
|
80
|
+
if ((await this.messageService.error(message, label)) === label) {
|
|
81
|
+
// The retried attempt reports afresh, progress included.
|
|
82
|
+
this.failing.delete(target);
|
|
83
|
+
retry();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
retryLabel() {
|
|
87
|
+
return core_1.nls.localize('hydranium/client-theia/connection-retry', 'Retry');
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.DefaultConnectionReporter = DefaultConnectionReporter;
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, inversify_1.inject)(core_1.MessageService),
|
|
93
|
+
__metadata("design:type", core_1.MessageService)
|
|
94
|
+
], DefaultConnectionReporter.prototype, "messageService", void 0);
|
|
95
|
+
exports.DefaultConnectionReporter = DefaultConnectionReporter = __decorate([
|
|
96
|
+
(0, inversify_1.injectable)()
|
|
97
|
+
], DefaultConnectionReporter);
|
|
98
|
+
/** Bind {@link DefaultConnectionReporter} unless the slot is bound already; every head calls this. */
|
|
99
|
+
function bindConnectionReporter(bind, isBound) {
|
|
100
|
+
if (!isBound(exports.ConnectionReporter)) {
|
|
101
|
+
bind(exports.ConnectionReporter).to(DefaultConnectionReporter).inSingletonScope();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=connection-reporter.js.map
|