@hydranium/client-theia 1.0.0-next.16 → 1.0.0-next.168

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.
Files changed (86) hide show
  1. package/README.md +39 -6
  2. package/lib/browser/channel-logger.d.ts +4 -3
  3. package/lib/browser/channel-logger.d.ts.map +1 -1
  4. package/lib/browser/channel-logger.js +9 -4
  5. package/lib/browser/channel-logger.js.map +1 -1
  6. package/lib/browser/connection-diagnostics-contribution.d.ts +69 -0
  7. package/lib/browser/connection-diagnostics-contribution.d.ts.map +1 -0
  8. package/lib/browser/connection-diagnostics-contribution.js +153 -0
  9. package/lib/browser/connection-diagnostics-contribution.js.map +1 -0
  10. package/lib/browser/connection-reporter.d.ts +57 -0
  11. package/lib/browser/connection-reporter.d.ts.map +1 -0
  12. package/lib/browser/connection-reporter.js +104 -0
  13. package/lib/browser/connection-reporter.js.map +1 -0
  14. package/lib/browser/editor-disk-sync.d.ts +133 -0
  15. package/lib/browser/editor-disk-sync.d.ts.map +1 -0
  16. package/lib/browser/editor-disk-sync.js +232 -0
  17. package/lib/browser/editor-disk-sync.js.map +1 -0
  18. package/lib/browser/hydranium-file-service.d.ts +44 -0
  19. package/lib/browser/hydranium-file-service.d.ts.map +1 -0
  20. package/lib/browser/hydranium-file-service.js +61 -0
  21. package/lib/browser/hydranium-file-service.js.map +1 -0
  22. package/lib/browser/index.d.ts +5 -0
  23. package/lib/browser/index.d.ts.map +1 -1
  24. package/lib/browser/index.js +5 -0
  25. package/lib/browser/index.js.map +1 -1
  26. package/lib/browser/log-level-preference.d.ts.map +1 -1
  27. package/lib/browser/log-level-preference.js +11 -0
  28. package/lib/browser/log-level-preference.js.map +1 -1
  29. package/lib/browser/memory-diagnostics-contribution.d.ts +40 -4
  30. package/lib/browser/memory-diagnostics-contribution.d.ts.map +1 -1
  31. package/lib/browser/memory-diagnostics-contribution.js +161 -31
  32. package/lib/browser/memory-diagnostics-contribution.js.map +1 -1
  33. package/lib/browser/session-aware-connection-source.d.ts +98 -0
  34. package/lib/browser/session-aware-connection-source.d.ts.map +1 -0
  35. package/lib/browser/session-aware-connection-source.js +167 -0
  36. package/lib/browser/session-aware-connection-source.js.map +1 -0
  37. package/lib/common/clock.d.ts +19 -0
  38. package/lib/common/clock.d.ts.map +1 -0
  39. package/lib/common/clock.js +13 -0
  40. package/lib/common/clock.js.map +1 -0
  41. package/lib/common/connection-resilience-options.d.ts +24 -0
  42. package/lib/common/connection-resilience-options.d.ts.map +1 -0
  43. package/lib/common/connection-resilience-options.js +11 -0
  44. package/lib/common/connection-resilience-options.js.map +1 -0
  45. package/lib/common/framed-socket-write-buffer.d.ts +121 -0
  46. package/lib/common/framed-socket-write-buffer.d.ts.map +1 -0
  47. package/lib/common/framed-socket-write-buffer.js +190 -0
  48. package/lib/common/framed-socket-write-buffer.js.map +1 -0
  49. package/lib/common/index.d.ts +12 -0
  50. package/lib/common/index.d.ts.map +1 -0
  51. package/lib/common/index.js +31 -0
  52. package/lib/common/index.js.map +1 -0
  53. package/lib/node/abstract-socket-forwarding-connection-handler.d.ts +12 -8
  54. package/lib/node/abstract-socket-forwarding-connection-handler.d.ts.map +1 -1
  55. package/lib/node/abstract-socket-forwarding-connection-handler.js +70 -13
  56. package/lib/node/abstract-socket-forwarding-connection-handler.js.map +1 -1
  57. package/lib/node/index.d.ts +2 -0
  58. package/lib/node/index.d.ts.map +1 -1
  59. package/lib/node/index.js +2 -0
  60. package/lib/node/index.js.map +1 -1
  61. package/lib/node/session-bound-frontend-connection-service.d.ts +77 -0
  62. package/lib/node/session-bound-frontend-connection-service.d.ts.map +1 -0
  63. package/lib/node/session-bound-frontend-connection-service.js +128 -0
  64. package/lib/node/session-bound-frontend-connection-service.js.map +1 -0
  65. package/lib/node/socket-channel-forwarder.d.ts +54 -0
  66. package/lib/node/socket-channel-forwarder.d.ts.map +1 -0
  67. package/lib/node/socket-channel-forwarder.js +93 -0
  68. package/lib/node/socket-channel-forwarder.js.map +1 -0
  69. package/package.json +20 -5
  70. package/src/browser/channel-logger.ts +9 -4
  71. package/src/browser/connection-diagnostics-contribution.ts +142 -0
  72. package/src/browser/connection-reporter.ts +121 -0
  73. package/src/browser/editor-disk-sync.ts +236 -0
  74. package/src/browser/hydranium-file-service.ts +56 -0
  75. package/src/browser/index.ts +5 -0
  76. package/src/browser/log-level-preference.ts +11 -0
  77. package/src/browser/memory-diagnostics-contribution.ts +268 -45
  78. package/src/browser/session-aware-connection-source.ts +179 -0
  79. package/src/common/clock.ts +20 -0
  80. package/src/common/connection-resilience-options.ts +24 -0
  81. package/src/common/framed-socket-write-buffer.ts +227 -0
  82. package/src/common/index.ts +15 -0
  83. package/src/node/abstract-socket-forwarding-connection-handler.ts +61 -15
  84. package/src/node/index.ts +2 -0
  85. package/src/node/session-bound-frontend-connection-service.ts +155 -0
  86. package/src/node/socket-channel-forwarder.ts +99 -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,21 @@ 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. You bind it as a
48
+ `FrontendApplicationContribution`.
49
+ - **`HydraniumFileService`** — Theia's `FileService`, refusing an editor's
50
+ incremental save once the file's mtime has moved past the one the editor
51
+ read, so the editor writes its whole text instead. Theia's own check passes a
52
+ file of unchanged size, and the save then applies the editor's edits to a
53
+ file that may already hold them; `write` keeps Theia's check. The safety net
54
+ behind `EditorDiskSync`, for a save the sync cannot catch. You bind it with
55
+ `rebind(FileService).to(HydraniumFileService).inSingletonScope()`.
35
56
  - **`captureBrowserRuntime` / `formatBrowserRuntime`** — the renderer's own memory
36
57
  reading as a `BrowserRuntimeReport`, preferring the standardized
37
58
  `performance.measureUserAgentSpecificMemory()` and falling back to Chromium's
@@ -43,6 +64,14 @@ hydranium server; a non-Theia host does not need it.
43
64
  forwarder bridges the two; port discovery, connect orchestration, and the
44
65
  buffer-and-replay fix for frontend writes that arrive before the forwarder is
45
66
  wired all live here.
67
+ - **`SocketChannelForwarder`** (Node side) — the byte forwarder both heads plug
68
+ into that hook. When the frontend channel closes, it finishes the writes it
69
+ still has queued before it ends the socket, so a message sent just before a
70
+ page goes away still reaches the server.
71
+ - **`Clock`** (either side) — the protocol's `Clock` as an injection token.
72
+ The frontend and backend classes above that time or bound something inject
73
+ it as optional and use a `SystemClock` when the container binds none, so a
74
+ container can supply another clock.
46
75
  - **`./testing`** — `makeStubOutputChannelManager` and `makeStubInversifyContext`,
47
76
  the doubles that let the pieces above be unit-tested without a Theia
48
77
  application.
@@ -60,8 +89,11 @@ declared peer dependencies are:
60
89
  | --------------------- | ------------- |
61
90
  | `@hydranium/protocol` | `^1.0.0-next` |
62
91
  | `@theia/core` | `^1.70.0` |
92
+ | `@theia/editor` | `^1.70.0` |
93
+ | `@theia/filesystem` | `^1.70.0` |
63
94
  | `@theia/output` | `^1.70.0` |
64
95
  | `inversify` | `^6.0.0` |
96
+ | `vscode-jsonrpc` | `9.0.1` |
65
97
 
66
98
  `@theia/output` is easy to miss: the memory-diagnostics commands and the channel
67
99
  logger both write to an Output channel, so a host that does not already depend on
@@ -86,12 +118,13 @@ from here:
86
118
 
87
119
  ## Entry points
88
120
 
89
- | Subpath | Holds | Environment |
90
- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
91
- | `.` | Nothing. Deliberately empty, so an environment-specific import cannot reach the wrong bundle through a barrel. | browser-neutral (gated) |
92
- | `./browser` | `ChannelLogger`, `ChannelTracer`, `LogLevelPreferenceContribution`, `MemoryDiagnosticsContribution`, the `bind*` helpers, `captureBrowserRuntime` | browser / Theia frontend (gated) |
93
- | `./node` | `AbstractSocketForwardingConnectionHandler` and its options — imports `node:net` | Node / Theia backend |
94
- | `./testing` | `makeStubOutputChannelManager`, `makeStubInversifyContext` | browser-neutral (gated) |
121
+ | Subpath | Holds | Environment |
122
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
123
+ | `.` | Nothing. Deliberately empty, so an environment-specific import cannot reach the wrong bundle through a barrel. | browser-neutral (gated) |
124
+ | `./browser` | `ChannelLogger`, `ChannelTracer`, `ConnectionReporter`, `DefaultConnectionReporter`, `LogLevelPreferenceContribution`, `MemoryDiagnosticsContribution`, `EditorDiskSync`, `HydraniumFileService`, the `bind*` helpers, `captureBrowserRuntime` | browser / Theia frontend (gated) |
125
+ | `./common` | `Clock`, the framed socket write buffer and the connection-resilience options | browser-neutral (gated) |
126
+ | `./node` | `AbstractSocketForwardingConnectionHandler` and its options, `SocketChannelForwarder` — imports `node:net` | Node / Theia backend |
127
+ | `./testing` | `makeStubOutputChannelManager`, `makeStubInversifyContext` | browser-neutral (gated) |
95
128
 
96
129
  Every subpath also has a `./lib/<name>` twin, so a consumer on
97
130
  `moduleResolution: "Node"` can reach it. "Gated" means the entry is enforced
@@ -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) + a {@link SystemClock} + a browser
65
- * heap reader. The browser head has no Langium `services.Tracer` slot, so this
66
- * is how frontend services that time obtain a tracer: `@inject(ChannelTracer)`.
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;AAEpG;;;;;;;;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,a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ACH,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;gBAGiB,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,oBAAoB,EACjE,SAAS,GAAE,MAAM,GAAG,SAA6B;IAKjE,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;IAOhG;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAQ3C;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');
@@ -89,9 +90,10 @@ exports.ChannelLogger = ChannelLogger = __decorate([
89
90
  const ChannelLoggerBase = Symbol('ChannelLoggerBase');
90
91
  /**
91
92
  * Inversify token for the browser `Tracer` — a {@link DefaultTracer} over
92
- * the {@link ChannelLogger} (emit sink) + a {@link SystemClock} + a browser
93
- * heap reader. The browser head has no Langium `services.Tracer` slot, so this
94
- * is how frontend services that time obtain a tracer: `@inject(ChannelTracer)`.
93
+ * the {@link ChannelLogger} (emit sink) + the container's {@link Clock}, or a
94
+ * `SystemClock` when it binds none, + a browser heap reader. The browser head
95
+ * has no Langium `services.Tracer` slot, so this is how frontend services that
96
+ * time obtain a tracer: `@inject(ChannelTracer)`.
95
97
  * Bound by {@link bindChannelLogger}.
96
98
  */
97
99
  exports.ChannelTracer = Symbol('ChannelTracer');
@@ -127,7 +129,10 @@ function bindChannelLogger(bind, options) {
127
129
  return parentName ? base.for(parentName) : base;
128
130
  });
129
131
  bind(exports.ChannelTracer)
130
- .toDynamicValue(ctx => new protocol_1.DefaultTracer(ctx.container.get(ChannelLoggerBase), new protocol_1.SystemClock(), readBrowserMemory))
132
+ .toDynamicValue(ctx => {
133
+ const clock = ctx.container.isBound(clock_1.Clock) ? ctx.container.get(clock_1.Clock) : new protocol_1.SystemClock();
134
+ return new protocol_1.DefaultTracer(ctx.container.get(ChannelLoggerBase), clock, readBrowserMemory);
135
+ })
131
136
  .inSingletonScope();
132
137
  }
133
138
  /** 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;;;;;;;;;;;;;;;AAkGlF,oDAOC;AAeD,8CAWC;AAjID,kDAAmH;AACnH,4DAA8F;AAC9F,6EAAoG;AAkBpG;sFACsF;AACzE,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,yBAAc;IAIM;IACA;IAJ1C,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C,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAQ,aAAK,CAAC,CAAC,CAAC,CAAC,IAAI,sBAAW,EAAE,CAAC;QACjG,OAAO,IAAI,wBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;IAC3G,CAAC,CAAC;SACD,gBAAgB,EAAE,CAAC;AAC1B,CAAC;AAMD,6GAA6G;AAC7G,MAAM,iBAAiB,GAAiB,GAAG,EAAE;IAC1C,MAAM,GAAG,GAAI,WAA8C,CAAC,MAAM,CAAC;IACnE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/F,CAAC,CAAC;AAEF,SAAS,YAAY,CAAC,GAAY;IAC/B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACN,OAAO,MAAM,CAAC,GAAG,CAAC,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.ts","sourceRoot":"","sources":["../../src/browser/connection-diagnostics-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAO,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC9G,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;;;;;;;;;;;;;GAaG;AACH,qBACa,iCAAkC,YAAW,+BAA+B;IACnD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;IACjE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;IACvE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IACxC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAE1E,oGAAoG;IACpG,SAAS,CAAC,YAAY,SAAK;IAC3B,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE7B,UAAU,IAAI,IAAI;IAalB,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAMlC,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAKnC;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAYnC,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAmB5D;;;;;;OAMG;IACH,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAUxE,SAAS,CAAC,QAAQ,IAAI,MAAM;IAI5B,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM;CAGxD;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;;;;;;;;;;;;AAmIlF,8DAGC;AApID,sCAAkD;AAClD,iHAA4G;AAC5G,iGAA8G;AAC9G,iGAAmG;AACnG,4DAAmF;AAEnF,qDAAiD;AACjD,uFAAiF;AAEjF;;;;;;;;;;;;;GAaG;AAEI,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IACW,gBAAgB,CAA4B;IAC9C,gBAAgB,CAA0B;IACpD,MAAM,CAAgB;IACrB,cAAc,CAAiB;IAE1E,oGAAoG;IAC1F,YAAY,GAAG,CAAC,CAAC;IACjB,cAAc,CAAU;IACxB,SAAS,CAAU;IAE7B,UAAU;QACP,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACrE,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;QAChF,IAAI,IAAI,CAAC,gBAAgB,YAAY,8DAA4B,EAAE,CAAC;YACjE,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3F,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,kBAAM,EAAC,gDAAyB,CAAC;8BAAsC,gDAAyB;2EAAC;AAC9C;IAAnD,IAAA,kBAAM,EAAC,mDAAuB,CAAC;;2EAA8D;AACpD;IAAzC,IAAA,kBAAM,EAAC,8BAAa,CAAC;8BAA4B,8BAAa;iEAAC;AACrB;IAA1C,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAAoC,qBAAc;yEAAC;4CAJhE,iCAAiC;IAD7C,IAAA,sBAAU,GAAE;GACA,iCAAiC,CA+F7C;AAED;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CAAC,IAAqB;IAC5D,IAAI,CAAC,iCAAiC,CAAC,CAAC,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;IAiCvD,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIrE,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;cAIvC,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAaxG,SAAS,CAAC,UAAU,IAAI,MAAM;CAGhC;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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-reporter.js","sourceRoot":"","sources":["../../src/browser/connection-reporter.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AA6GlF,wDAIC;AA/GD,sCAAiE;AACjE,4DAAmF;AA8BtE,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAE/D;;;;;GAKG;AAEI,IAAM,yBAAyB,GA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