@hydranium/client-theia 1.0.0-next.9 → 1.0.0-next.91
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 -2
- 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/index.d.ts +2 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +2 -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 +98 -0
- package/lib/browser/session-aware-connection-source.d.ts.map +1 -0
- package/lib/browser/session-aware-connection-source.js +167 -0
- package/lib/browser/session-aware-connection-source.js.map +1 -0
- package/lib/common/connection-resilience-options.d.ts +24 -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 +121 -0
- package/lib/common/framed-socket-write-buffer.d.ts.map +1 -0
- package/lib/common/framed-socket-write-buffer.js +190 -0
- package/lib/common/framed-socket-write-buffer.js.map +1 -0
- package/lib/common/index.d.ts +11 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +30 -0
- package/lib/common/index.js.map +1 -0
- package/lib/node/abstract-socket-forwarding-connection-handler.d.ts.map +1 -1
- package/lib/node/abstract-socket-forwarding-connection-handler.js +6 -1
- package/lib/node/abstract-socket-forwarding-connection-handler.js.map +1 -1
- package/lib/node/index.d.ts +1 -0
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +1 -0
- package/lib/node/index.js.map +1 -1
- package/lib/node/session-bound-frontend-connection-service.d.ts +77 -0
- package/lib/node/session-bound-frontend-connection-service.d.ts.map +1 -0
- package/lib/node/session-bound-frontend-connection-service.js +128 -0
- package/lib/node/session-bound-frontend-connection-service.js.map +1 -0
- package/package.json +16 -7
- package/src/browser/connection-diagnostics-contribution.ts +142 -0
- package/src/browser/index.ts +2 -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 +179 -0
- package/src/common/connection-resilience-options.ts +24 -0
- package/src/common/framed-socket-write-buffer.ts +227 -0
- package/src/common/index.ts +14 -0
- package/src/node/abstract-socket-forwarding-connection-handler.ts +6 -1
- package/src/node/index.ts +1 -0
- package/src/node/session-bound-frontend-connection-service.ts +155 -0
|
@@ -59,71 +59,123 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
59
59
|
* localized apart, leaving a button or an instruction that names a command
|
|
60
60
|
* the user cannot find.
|
|
61
61
|
*/
|
|
62
|
-
stopProfilingLabel = 'Stop Profiling (Server)';
|
|
62
|
+
stopProfilingLabel = core_1.nls.localize('hydranium/client-theia/command-stop-profiling-server', 'Stop Profiling (Server)');
|
|
63
63
|
registerCommands(registry) {
|
|
64
64
|
const { category } = this.options;
|
|
65
|
-
registry.registerCommand(this.command(
|
|
66
|
-
|
|
65
|
+
registry.registerCommand(this.command({
|
|
66
|
+
id: 'dumpServerState',
|
|
67
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-server-state', 'Dump Server State'),
|
|
68
|
+
category
|
|
69
|
+
}), {
|
|
70
|
+
execute: () => this.report('server-state', () => this.diagnostics.dumpServerState({ label: new Date().toISOString() }), ['heap'])
|
|
67
71
|
});
|
|
68
|
-
registry.registerCommand(this.command(
|
|
69
|
-
|
|
72
|
+
registry.registerCommand(this.command({
|
|
73
|
+
id: 'dumpPodMemory',
|
|
74
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-pod-memory', 'Dump Pod Memory'),
|
|
75
|
+
category
|
|
76
|
+
}), {
|
|
77
|
+
execute: () => this.report('pod-memory', () => this.diagnostics.dumpPodMemory(), ['current', 'rss sum'])
|
|
70
78
|
});
|
|
71
|
-
registry.registerCommand(this.command(
|
|
79
|
+
registry.registerCommand(this.command({
|
|
80
|
+
id: 'dumpFrontendState',
|
|
81
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-frontend-state', 'Dump Frontend State'),
|
|
82
|
+
category
|
|
83
|
+
}), {
|
|
72
84
|
execute: () => this.dumpFrontendState()
|
|
73
85
|
});
|
|
74
|
-
registry.registerCommand(this.command(
|
|
86
|
+
registry.registerCommand(this.command({
|
|
87
|
+
id: 'writeHeapSnapshot',
|
|
88
|
+
label: core_1.nls.localize('hydranium/client-theia/command-write-heap-snapshot-server', 'Write Heap Snapshot (Server)'),
|
|
89
|
+
category
|
|
90
|
+
}), {
|
|
75
91
|
execute: () => this.writeSnapshot('server', label => this.diagnostics.writeHeapSnapshot({ label }))
|
|
76
92
|
});
|
|
77
93
|
// Sampled profiling of the server process — sampling does NOT pause it (unlike
|
|
78
94
|
// the heap snapshot). Start/Stop are the manual pair; Record wraps a fixed window.
|
|
79
|
-
registry.registerCommand(this.command(
|
|
95
|
+
registry.registerCommand(this.command({
|
|
96
|
+
id: 'startProfiling',
|
|
97
|
+
label: core_1.nls.localize('hydranium/client-theia/command-start-profiling-server', 'Start Profiling (Server)'),
|
|
98
|
+
category
|
|
99
|
+
}), {
|
|
80
100
|
execute: () => this.startProfiling()
|
|
81
101
|
});
|
|
82
|
-
registry.registerCommand(this.command('stopProfiling', this.stopProfilingLabel, category), {
|
|
102
|
+
registry.registerCommand(this.command({ id: 'stopProfiling', label: this.stopProfilingLabel, category }), {
|
|
83
103
|
execute: () => this.stopProfiling()
|
|
84
104
|
});
|
|
85
|
-
registry.registerCommand(this.command(
|
|
105
|
+
registry.registerCommand(this.command({
|
|
106
|
+
id: 'recordProfile',
|
|
107
|
+
// The window length rides the substitution path rather than a
|
|
108
|
+
// template literal: an extractor reads the source text, so an
|
|
109
|
+
// interpolated default is never in the catalogue at all.
|
|
110
|
+
label: core_1.nls.localize('hydranium/client-theia/command-record-profile', 'Record Performance Profile (Server, {0}s)', this.recordDurationSeconds()),
|
|
111
|
+
category
|
|
112
|
+
}), {
|
|
86
113
|
execute: () => this.recordProfile()
|
|
87
114
|
});
|
|
88
|
-
registry.registerCommand(this.command(
|
|
89
|
-
|
|
115
|
+
registry.registerCommand(this.command({
|
|
116
|
+
id: 'dumpLatency',
|
|
117
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-latency', 'Dump RPC/LSP Latency (Server)'),
|
|
118
|
+
category
|
|
119
|
+
}), {
|
|
120
|
+
execute: () => this.report('latency', async () => (0, protocol_1.formatLatencyReport)(await this.diagnostics.getLatency()), ['window'])
|
|
90
121
|
});
|
|
91
122
|
// Host (Theia backend) process commands — registered only when the
|
|
92
123
|
// optional host-diagnostics service is bound (see HostMemoryDiagnosticsService).
|
|
93
124
|
const hostDiagnostics = this.hostDiagnostics;
|
|
94
125
|
if (hostDiagnostics) {
|
|
95
|
-
registry.registerCommand(this.command(
|
|
96
|
-
|
|
126
|
+
registry.registerCommand(this.command({
|
|
127
|
+
id: 'dumpBackendState',
|
|
128
|
+
label: core_1.nls.localize('hydranium/client-theia/command-dump-backend-state', 'Dump Backend State'),
|
|
129
|
+
category
|
|
130
|
+
}), {
|
|
131
|
+
execute: () => this.report('backend-state', () => hostDiagnostics.dumpHostState({ label: new Date().toISOString() }), ['heap'])
|
|
97
132
|
});
|
|
98
|
-
registry.registerCommand(this.command(
|
|
133
|
+
registry.registerCommand(this.command({
|
|
134
|
+
id: 'writeBackendHeapSnapshot',
|
|
135
|
+
label: core_1.nls.localize('hydranium/client-theia/command-write-heap-snapshot-backend', 'Write Heap Snapshot (Backend)'),
|
|
136
|
+
category
|
|
137
|
+
}), {
|
|
99
138
|
execute: () => this.writeSnapshot('backend', label => hostDiagnostics.writeHostHeapSnapshot({ label }))
|
|
100
139
|
});
|
|
101
140
|
}
|
|
102
141
|
}
|
|
103
|
-
|
|
104
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Takes an object rather than positional arguments so that `label` — the one
|
|
144
|
+
* user-facing member — is addressable by name. A lint rule guarding the
|
|
145
|
+
* localization of labels has only syntax to work with, and a selector for an
|
|
146
|
+
* argument position would equally catch `id`, which must stay a bare literal.
|
|
147
|
+
*/
|
|
148
|
+
command(spec) {
|
|
149
|
+
return { id: `${this.options.commandIdPrefix}.${spec.id}`, label: spec.label, category: spec.category };
|
|
150
|
+
}
|
|
151
|
+
/** The record window as whole seconds, for the label and the toast that must agree on it. */
|
|
152
|
+
recordDurationSeconds() {
|
|
153
|
+
return Math.round(this.recordDurationMs / 1000);
|
|
105
154
|
}
|
|
106
155
|
/** Run a snapshot call, append the full result to the channel, toast the first matching summary line. */
|
|
107
|
-
async report(
|
|
156
|
+
async report(subject, produce, summaryKeys) {
|
|
108
157
|
try {
|
|
109
158
|
const snapshot = await produce();
|
|
110
159
|
this.channel().appendLine(snapshot);
|
|
111
160
|
this.channel().appendLine('');
|
|
112
|
-
this.messageService.info(this.summarize(snapshot,
|
|
161
|
+
this.messageService.info(this.summarize(snapshot, subject, summaryKeys), { timeout: 5000 });
|
|
113
162
|
}
|
|
114
163
|
catch (error) {
|
|
115
|
-
this.messageService.error(
|
|
164
|
+
this.messageService.error(this.dumpFailedMessage(subject, this.errorMessage(error)));
|
|
116
165
|
}
|
|
117
166
|
}
|
|
118
167
|
async writeSnapshot(target, produce) {
|
|
119
168
|
try {
|
|
120
|
-
this.messageService.info(
|
|
169
|
+
this.messageService.info(this.writingSnapshotMessage(target), { timeout: 3000 });
|
|
121
170
|
const filePath = await produce(new Date().toISOString());
|
|
122
|
-
|
|
123
|
-
|
|
171
|
+
// One sentence, shown in both places: two literals of equal value can be
|
|
172
|
+
// localized apart, leaving the channel and the toast naming different files.
|
|
173
|
+
const written = this.wroteSnapshotMessage(target, filePath);
|
|
174
|
+
this.channel().appendLine(written);
|
|
175
|
+
this.messageService.info(written, { timeout: 8000 });
|
|
124
176
|
}
|
|
125
177
|
catch (error) {
|
|
126
|
-
this.messageService.error(
|
|
178
|
+
this.messageService.error(this.writeSnapshotFailedMessage(target, this.errorMessage(error)));
|
|
127
179
|
}
|
|
128
180
|
}
|
|
129
181
|
/** Begin an open-ended capture; the toast's stop action ends it and reports. */
|
|
@@ -132,14 +184,14 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
132
184
|
await this.diagnostics.startProfiling(this.profileDimensions);
|
|
133
185
|
}
|
|
134
186
|
catch (error) {
|
|
135
|
-
this.messageService.error(
|
|
187
|
+
this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
|
|
136
188
|
return;
|
|
137
189
|
}
|
|
138
190
|
// No timeout: the capture runs as long as the user wants it to, and an
|
|
139
191
|
// auto-dismissing toast takes the stop affordance with it. Awaiting the
|
|
140
192
|
// toast is what keeps the action live, so this resolves only once the
|
|
141
193
|
// user acts on it or dismisses it.
|
|
142
|
-
const chosen = await this.messageService.info('Server profiling started — sampling does not stop the process.', { timeout: 0 }, this.stopProfilingLabel);
|
|
194
|
+
const chosen = await this.messageService.info(core_1.nls.localize('hydranium/client-theia/profiling-started', 'Server profiling started — sampling does not stop the process.'), { timeout: 0 }, this.stopProfilingLabel);
|
|
143
195
|
if (chosen === this.stopProfilingLabel) {
|
|
144
196
|
await this.stopProfiling();
|
|
145
197
|
}
|
|
@@ -148,16 +200,20 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
148
200
|
stopProfiling() {
|
|
149
201
|
return this.report('profile', () => this.diagnostics.stopProfiling({ label: new Date().toISOString() }), ['duration']);
|
|
150
202
|
}
|
|
203
|
+
/** One authored sentence for both start paths; identical literals in two places drift apart under translation. */
|
|
204
|
+
startProfilingFailedMessage(detail) {
|
|
205
|
+
return core_1.nls.localize('hydranium/client-theia/error-start-profiling', 'Failed to start profiling: {0}', detail);
|
|
206
|
+
}
|
|
151
207
|
/** Capture a fixed-length window: start, wait, stop, and report the result. */
|
|
152
208
|
async recordProfile() {
|
|
153
209
|
try {
|
|
154
210
|
await this.diagnostics.startProfiling(this.profileDimensions);
|
|
155
211
|
}
|
|
156
212
|
catch (error) {
|
|
157
|
-
this.messageService.error(
|
|
213
|
+
this.messageService.error(this.startProfilingFailedMessage(this.errorMessage(error)));
|
|
158
214
|
return;
|
|
159
215
|
}
|
|
160
|
-
this.messageService.info(
|
|
216
|
+
this.messageService.info(core_1.nls.localize('hydranium/client-theia/recording-profile', 'Recording a {0}s server performance profile...', this.recordDurationSeconds()), { timeout: 4000 });
|
|
161
217
|
await this.delay(this.recordDurationMs);
|
|
162
218
|
await this.stopProfiling();
|
|
163
219
|
}
|
|
@@ -176,15 +232,89 @@ let MemoryDiagnosticsContribution = class MemoryDiagnosticsContribution {
|
|
|
176
232
|
return channel;
|
|
177
233
|
}
|
|
178
234
|
/** Pull the first line starting with one of `keys` for a one-line toast; full text is in the channel. */
|
|
179
|
-
summarize(snapshot,
|
|
235
|
+
summarize(snapshot, subject, keys) {
|
|
180
236
|
const lines = snapshot.split('\n');
|
|
181
237
|
for (const key of keys) {
|
|
182
238
|
const line = lines.find(entry => entry.trim().startsWith(key));
|
|
183
239
|
if (line) {
|
|
184
|
-
return
|
|
240
|
+
return this.capturedDetailMessage(subject, line.replace(new RegExp(`^\\s*${key}\\s*`), ` ${key} `));
|
|
185
241
|
}
|
|
186
242
|
}
|
|
187
|
-
return
|
|
243
|
+
return this.capturedChannelMessage(subject);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* The captured-with-detail toast. The detail is a machine-formatted figure,
|
|
247
|
+
* so it is safe as a substitution parameter; the subject is not, hence one
|
|
248
|
+
* authored sentence per subject.
|
|
249
|
+
*/
|
|
250
|
+
capturedDetailMessage(subject, detail) {
|
|
251
|
+
switch (subject) {
|
|
252
|
+
case 'server-state':
|
|
253
|
+
return core_1.nls.localize('hydranium/client-theia/captured-server-state-detail', 'Captured server state —{0}', detail);
|
|
254
|
+
case 'pod-memory':
|
|
255
|
+
return core_1.nls.localize('hydranium/client-theia/captured-pod-memory-detail', 'Captured pod memory —{0}', detail);
|
|
256
|
+
case 'latency':
|
|
257
|
+
return core_1.nls.localize('hydranium/client-theia/captured-latency-detail', 'Captured RPC/LSP latency —{0}', detail);
|
|
258
|
+
case 'backend-state':
|
|
259
|
+
return core_1.nls.localize('hydranium/client-theia/captured-backend-state-detail', 'Captured backend state —{0}', detail);
|
|
260
|
+
case 'profile':
|
|
261
|
+
return core_1.nls.localize('hydranium/client-theia/captured-profile-detail', 'Captured profile —{0}', detail);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/** The captured-without-detail toast; the channel name is adopter branding, not translatable text. */
|
|
265
|
+
capturedChannelMessage(subject) {
|
|
266
|
+
const channelName = this.options.channelName;
|
|
267
|
+
switch (subject) {
|
|
268
|
+
case 'server-state':
|
|
269
|
+
return core_1.nls.localize('hydranium/client-theia/captured-server-state-channel', 'Captured server state (see the {0} output channel)', channelName);
|
|
270
|
+
case 'pod-memory':
|
|
271
|
+
return core_1.nls.localize('hydranium/client-theia/captured-pod-memory-channel', 'Captured pod memory (see the {0} output channel)', channelName);
|
|
272
|
+
case 'latency':
|
|
273
|
+
return core_1.nls.localize('hydranium/client-theia/captured-latency-channel', 'Captured RPC/LSP latency (see the {0} output channel)', channelName);
|
|
274
|
+
case 'backend-state':
|
|
275
|
+
return core_1.nls.localize('hydranium/client-theia/captured-backend-state-channel', 'Captured backend state (see the {0} output channel)', channelName);
|
|
276
|
+
case 'profile':
|
|
277
|
+
return core_1.nls.localize('hydranium/client-theia/captured-profile-channel', 'Captured profile (see the {0} output channel)', channelName);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/** The failed-to-dump toast; the detail is a technical error string, safe as a parameter. */
|
|
281
|
+
dumpFailedMessage(subject, detail) {
|
|
282
|
+
switch (subject) {
|
|
283
|
+
case 'server-state':
|
|
284
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-server-state', 'Failed to dump server state: {0}', detail);
|
|
285
|
+
case 'pod-memory':
|
|
286
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-pod-memory', 'Failed to dump pod memory: {0}', detail);
|
|
287
|
+
case 'latency':
|
|
288
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-latency', 'Failed to dump RPC/LSP latency: {0}', detail);
|
|
289
|
+
case 'backend-state':
|
|
290
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-backend-state', 'Failed to dump backend state: {0}', detail);
|
|
291
|
+
case 'profile':
|
|
292
|
+
return core_1.nls.localize('hydranium/client-theia/error-dump-profile', 'Failed to dump profile: {0}', detail);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
writingSnapshotMessage(target) {
|
|
296
|
+
switch (target) {
|
|
297
|
+
case 'server':
|
|
298
|
+
return core_1.nls.localize('hydranium/client-theia/writing-heap-snapshot-server', 'Writing server heap snapshot — this briefly pauses that process...');
|
|
299
|
+
case 'backend':
|
|
300
|
+
return core_1.nls.localize('hydranium/client-theia/writing-heap-snapshot-backend', 'Writing backend heap snapshot — this briefly pauses that process...');
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
wroteSnapshotMessage(target, filePath) {
|
|
304
|
+
switch (target) {
|
|
305
|
+
case 'server':
|
|
306
|
+
return core_1.nls.localize('hydranium/client-theia/wrote-heap-snapshot-server', 'Heap snapshot (server) written to {0}', filePath);
|
|
307
|
+
case 'backend':
|
|
308
|
+
return core_1.nls.localize('hydranium/client-theia/wrote-heap-snapshot-backend', 'Heap snapshot (backend) written to {0}', filePath);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
writeSnapshotFailedMessage(target, detail) {
|
|
312
|
+
switch (target) {
|
|
313
|
+
case 'server':
|
|
314
|
+
return core_1.nls.localize('hydranium/client-theia/error-write-heap-snapshot-server', 'Failed to write server heap snapshot: {0}', detail);
|
|
315
|
+
case 'backend':
|
|
316
|
+
return core_1.nls.localize('hydranium/client-theia/error-write-heap-snapshot-backend', 'Failed to write backend heap snapshot: {0}', detail);
|
|
317
|
+
}
|
|
188
318
|
}
|
|
189
319
|
errorMessage(error) {
|
|
190
320
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AA4OlF,sDAIC;AA9OD,kDAK6B;AAC7B,uDAAgF;AAChF,sCAAsG;AACtG,4DAA6F;AAC7F,6EAAoG;AAevF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAU9D,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAW9D,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAEnF;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACc,WAAW,CAA2B;IACtC,OAAO,CAA2B;IAC5C,cAAc,CAAiB;IACzB,QAAQ,CAAuB;IACX,eAAe,CAAgC;IAEpH,yFAAyF;IACtE,iBAAiB,GAAuB,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IAC3H,kEAAkE;IAC/C,gBAAgB,GAAG,MAAM,CAAC;IAC7C;;;;;OAKG;IACgB,kBAAkB,GAAW,yBAAyB,CAAC;IAE1E,gBAAgB,CAAC,QAAyB;QACvC,MAAM,EAAE,QAAQ,EAAE,G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B;IAAhD,IAAA,kBAAM,EAAC,qCAAoB,CAAC;8BAA8B,qCAAoB;+DAAC;AACX;IAApE,IAAA,kBAAM,EAAC,oCAA4B,CAAC;IAAE,IAAA,oBAAQ,GAAE;;sEAAmE;wCAL1G,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAkKzC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAqB,EAAE,OAAiC;IAC3F,IAAI,CAAC,gCAAwB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;AACtE,CAAC"}
|
|
1
|
+
{"version":3,"file":"memory-diagnostics-contribution.js","sourceRoot":"","sources":["../../src/browser/memory-diagnostics-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AA2clF,sDAIC;AA7cD,kDAK6B;AAC7B,uDAAgF;AAChF,sCAA2G;AAC3G,4DAA6F;AAC7F,6EAAoG;AAevF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAU9D,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAW9D,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAanF;;;;;;;;;;;;;;;GAeG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACc,WAAW,CAA2B;IACtC,OAAO,CAA2B;IAC5C,cAAc,CAAiB;IACzB,QAAQ,CAAuB;IACX,eAAe,CAAgC;IAEpH,yFAAyF;IACtE,iBAAiB,GAAuB,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IAC3H,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2CAA2C,EAC3C,MAAM,CACR,CAAC;YACL,KAAK,SAAS;gBACX,OAAO,UAAG,CAAC,QAAQ,CAChB,0DAA0D,EAC1D,4CAA4C,EAC5C,MAAM,CACR,CAAC;QACR,CAAC;IACJ,CAAC;IAES,YAAY,CAAC,KAAc;QAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;CACH,CAAA;AAtXY,sEAA6B;AACc;IAApD,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;kEAA0D;AACtC;IAApD,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;8DAAsD;AAC5C;IAA1C,IAAA,kBAAM,EAAC,qBAAc,CAAC;8BAAoC,qBAAc;qEAAC;AACzB;IAAhD,IAAA,kBAAM,EAAC,qCAAoB,CAAC;8BAA8B,qCAAoB;+DAAC;AACX;IAApE,IAAA,kBAAM,EAAC,oCAA4B,CAAC;IAAE,IAAA,oBAAQ,GAAE;;sEAAmE;wCAL1G,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAsXzC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAqB,EAAE,OAAiC;IAC3F,IAAI,CAAC,gCAAwB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { WebSocketConnectionSource } from '@theia/core/lib/browser/messaging/ws-connection-source';
|
|
10
|
+
import { type Event } from '@theia/core/lib/common/event';
|
|
11
|
+
import { type AbstractChannel } from '@theia/core/lib/common/message-rpc/channel';
|
|
12
|
+
import { type interfaces } from '@theia/core/shared/inversify';
|
|
13
|
+
import { type ConnectionResilienceOptions } from '../common/connection-resilience-options';
|
|
14
|
+
import { type ConnectionBufferOverflow, FramedSocketWriteBuffer } from '../common/framed-socket-write-buffer';
|
|
15
|
+
/**
|
|
16
|
+
* Sends a message only once the server has confirmed the session, and only
|
|
17
|
+
* behind anything already queued.
|
|
18
|
+
*
|
|
19
|
+
* Theia sends straight away when `socket.connected` is true and buffers
|
|
20
|
+
* otherwise. The gap is that reconnecting sets that flag immediately, while the
|
|
21
|
+
* session is only confirmed a round trip later. A message produced in that
|
|
22
|
+
* window either jumps ahead of older messages still waiting in the buffer, or,
|
|
23
|
+
* if nothing was waiting, goes out on a socket whose channel the server has not
|
|
24
|
+
* attached yet and is discarded by a peer with no listener for it.
|
|
25
|
+
*
|
|
26
|
+
* Losing one or reordering them is equally unrecoverable for anything that
|
|
27
|
+
* applies messages by position. Theia's plugin host keeps a line-indexed copy of
|
|
28
|
+
* every open document, so a single late or missing edit leaves that copy wrong
|
|
29
|
+
* for good, and the next edit past its end fails.
|
|
30
|
+
*
|
|
31
|
+
* The server side needs no equivalent: it adopts its socket and flushes in one
|
|
32
|
+
* synchronous step, so it has no window of this kind.
|
|
33
|
+
*/
|
|
34
|
+
export declare class SessionAwareConnectionSource extends WebSocketConnectionSource {
|
|
35
|
+
/**
|
|
36
|
+
* Whether the server has confirmed, on the socket in use right now, that it
|
|
37
|
+
* still holds this frontend's session. A connected socket is not enough:
|
|
38
|
+
* until the handshake is answered the server has not attached its channel to
|
|
39
|
+
* this socket, and a message sent meanwhile reaches a peer with no listener
|
|
40
|
+
* for it and is discarded without a trace.
|
|
41
|
+
*/
|
|
42
|
+
protected sessionResumed: boolean;
|
|
43
|
+
protected sessionListenersAttached: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Every connect starts a socket the server has not confirmed yet, including
|
|
46
|
+
* the reconnects socket.io performs on its own. Resetting here rather than on
|
|
47
|
+
* disconnect also covers a connect that follows no clean disconnect event.
|
|
48
|
+
*/
|
|
49
|
+
protected handleSocketConnected(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Watches the connection handshake for its outcome.
|
|
52
|
+
*
|
|
53
|
+
* Attached once, to the socket socket.io reuses across reconnects, and before
|
|
54
|
+
* the base class adds its own per-negotiation listeners — so this has already
|
|
55
|
+
* recorded the outcome by the time the base class reacts to it by flushing.
|
|
56
|
+
*/
|
|
57
|
+
protected trackSessionState(): void;
|
|
58
|
+
/** Whether a message may go out now, as opposed to waiting in the buffer. */
|
|
59
|
+
protected get canSend(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Copied from Theia apart from the `onCommit` body, because the base builds that callback inline
|
|
62
|
+
* and exposes no narrower seam. Re-diff when the supported range moves.
|
|
63
|
+
*/
|
|
64
|
+
protected createChannel(): AbstractChannel;
|
|
65
|
+
/** Fires when the buffer runs out of room, so an adopter can say so rather than just stopping. */
|
|
66
|
+
get onBufferOverflow(): Event<ConnectionBufferOverflow>;
|
|
67
|
+
/**
|
|
68
|
+
* The write buffer Theia injected into the base class.
|
|
69
|
+
*
|
|
70
|
+
* Reached through a structural view rather than as `this.writeBuffer`,
|
|
71
|
+
* because that member is `private` in Theia 1.70 and only became `protected`
|
|
72
|
+
* in 1.71 — and this package compiles against the whole range. The view
|
|
73
|
+
* asserts nothing the versions disagree about: the field is there in both,
|
|
74
|
+
* holding whatever `SocketWriteBuffer` is bound, and the check below is what
|
|
75
|
+
* establishes it is ours.
|
|
76
|
+
*/
|
|
77
|
+
protected get framedBuffer(): FramedSocketWriteBuffer;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Replaces the frontend pieces that decide how outgoing messages survive a
|
|
81
|
+
* reconnect. Every one of them rebinds something Theia's
|
|
82
|
+
* `messagingFrontendModule` already bound, so this belongs in a module loaded
|
|
83
|
+
* into the same container.
|
|
84
|
+
*
|
|
85
|
+
* It must be a `frontendPreload` module rather than a normal frontend module:
|
|
86
|
+
* Theia's preloader resolves `WebSocketConnectionSource` (and with it the write
|
|
87
|
+
* buffer) while loading i18n and OS settings, which happens before any frontend
|
|
88
|
+
* module is loaded. A rebind there would come too late — the instances would
|
|
89
|
+
* already exist. All `frontendPreload` modules, by contrast, are loaded before
|
|
90
|
+
* the preloader constructs anything.
|
|
91
|
+
*
|
|
92
|
+
* Does nothing but warn on a Theia too old to expose the buffer binding, so the
|
|
93
|
+
* package keeps one supported range rather than splitting its floor for this
|
|
94
|
+
* feature. Returns whether the hardening was installed, for an adopter that
|
|
95
|
+
* wants to branch on it.
|
|
96
|
+
*/
|
|
97
|
+
export declare function bindConnectionResilience(isBound: interfaces.IsBound, rebind: interfaces.Rebind, options?: ConnectionResilienceOptions): boolean;
|
|
98
|
+
//# sourceMappingURL=session-aware-connection-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-aware-connection-source.d.ts","sourceRoot":"","sources":["../../src/browser/session-aware-connection-source.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAEnG,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,4CAA4C,CAAC;AAGrG,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EACJ,KAAK,wBAAwB,EAE7B,uBAAuB,EAGzB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,4BAA6B,SAAQ,yBAAyB;IACxE;;;;;;OAMG;IACH,SAAS,CAAC,cAAc,UAAS;IACjC,SAAS,CAAC,wBAAwB,UAAS;IAE3C;;;;OAIG;cACgB,qBAAqB,IAAI,IAAI;IAMhD;;;;;;OAMG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAanC,6EAA6E;IAC7E,SAAS,KAAK,OAAO,IAAI,OAAO,CAE/B;IAED;;;OAGG;cACgB,aAAa,IAAI,eAAe;IA0BnD,kGAAkG;IAClG,IAAI,gBAAgB,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAEtD;IAED;;;;;;;;;OASG;IACH,SAAS,KAAK,YAAY,IAAI,uBAAuB,CAMpD;CACH;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACrC,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,GAAE,2BAAgC,GACzC,OAAO,CAST"}
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SessionAwareConnectionSource = void 0;
|
|
18
|
+
exports.bindConnectionResilience = bindConnectionResilience;
|
|
19
|
+
const ws_connection_source_1 = require("@theia/core/lib/browser/messaging/ws-connection-source");
|
|
20
|
+
const disposable_1 = require("@theia/core/lib/common/disposable");
|
|
21
|
+
const channel_1 = require("@theia/core/lib/common/message-rpc/channel");
|
|
22
|
+
const uint8_array_message_buffer_1 = require("@theia/core/lib/common/message-rpc/uint8-array-message-buffer");
|
|
23
|
+
const connection_management_1 = require("@theia/core/lib/common/messaging/connection-management");
|
|
24
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
+
const socket_write_buffer_1 = require("@theia/core/lib/common/messaging/socket-write-buffer");
|
|
26
|
+
const framed_socket_write_buffer_1 = require("../common/framed-socket-write-buffer");
|
|
27
|
+
/**
|
|
28
|
+
* Sends a message only once the server has confirmed the session, and only
|
|
29
|
+
* behind anything already queued.
|
|
30
|
+
*
|
|
31
|
+
* Theia sends straight away when `socket.connected` is true and buffers
|
|
32
|
+
* otherwise. The gap is that reconnecting sets that flag immediately, while the
|
|
33
|
+
* session is only confirmed a round trip later. A message produced in that
|
|
34
|
+
* window either jumps ahead of older messages still waiting in the buffer, or,
|
|
35
|
+
* if nothing was waiting, goes out on a socket whose channel the server has not
|
|
36
|
+
* attached yet and is discarded by a peer with no listener for it.
|
|
37
|
+
*
|
|
38
|
+
* Losing one or reordering them is equally unrecoverable for anything that
|
|
39
|
+
* applies messages by position. Theia's plugin host keeps a line-indexed copy of
|
|
40
|
+
* every open document, so a single late or missing edit leaves that copy wrong
|
|
41
|
+
* for good, and the next edit past its end fails.
|
|
42
|
+
*
|
|
43
|
+
* The server side needs no equivalent: it adopts its socket and flushes in one
|
|
44
|
+
* synchronous step, so it has no window of this kind.
|
|
45
|
+
*/
|
|
46
|
+
let SessionAwareConnectionSource = class SessionAwareConnectionSource extends ws_connection_source_1.WebSocketConnectionSource {
|
|
47
|
+
/**
|
|
48
|
+
* Whether the server has confirmed, on the socket in use right now, that it
|
|
49
|
+
* still holds this frontend's session. A connected socket is not enough:
|
|
50
|
+
* until the handshake is answered the server has not attached its channel to
|
|
51
|
+
* this socket, and a message sent meanwhile reaches a peer with no listener
|
|
52
|
+
* for it and is discarded without a trace.
|
|
53
|
+
*/
|
|
54
|
+
sessionResumed = false;
|
|
55
|
+
sessionListenersAttached = false;
|
|
56
|
+
/**
|
|
57
|
+
* Every connect starts a socket the server has not confirmed yet, including
|
|
58
|
+
* the reconnects socket.io performs on its own. Resetting here rather than on
|
|
59
|
+
* disconnect also covers a connect that follows no clean disconnect event.
|
|
60
|
+
*/
|
|
61
|
+
handleSocketConnected() {
|
|
62
|
+
this.trackSessionState();
|
|
63
|
+
this.sessionResumed = false;
|
|
64
|
+
super.handleSocketConnected();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Watches the connection handshake for its outcome.
|
|
68
|
+
*
|
|
69
|
+
* Attached once, to the socket socket.io reuses across reconnects, and before
|
|
70
|
+
* the base class adds its own per-negotiation listeners — so this has already
|
|
71
|
+
* recorded the outcome by the time the base class reacts to it by flushing.
|
|
72
|
+
*/
|
|
73
|
+
trackSessionState() {
|
|
74
|
+
if (this.sessionListenersAttached) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.sessionListenersAttached = true;
|
|
78
|
+
this.socket.on(connection_management_1.ConnectionManagementMessages.INITIAL_CONNECT, () => {
|
|
79
|
+
this.sessionResumed = true;
|
|
80
|
+
});
|
|
81
|
+
this.socket.on(connection_management_1.ConnectionManagementMessages.RECONNECT, (hasConnection) => {
|
|
82
|
+
this.sessionResumed = hasConnection;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/** Whether a message may go out now, as opposed to waiting in the buffer. */
|
|
86
|
+
get canSend() {
|
|
87
|
+
return this.socket.connected && this.sessionResumed;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Copied from Theia apart from the `onCommit` body, because the base builds that callback inline
|
|
91
|
+
* and exposes no narrower seam. Re-diff when the supported range moves.
|
|
92
|
+
*/
|
|
93
|
+
createChannel() {
|
|
94
|
+
const toDispose = new disposable_1.DisposableCollection();
|
|
95
|
+
const messageHandler = (data) => {
|
|
96
|
+
this.onIncomingMessageActivityEmitter.fire();
|
|
97
|
+
if (this.currentChannel) {
|
|
98
|
+
// socket.io hands binary over as ArrayBuffer in the browser.
|
|
99
|
+
const buffer = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
|
|
100
|
+
this.currentChannel.onMessageEmitter.fire(() => new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer));
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
this.socket.on('message', messageHandler);
|
|
104
|
+
toDispose.push(disposable_1.Disposable.create(() => this.socket.off('message', messageHandler)));
|
|
105
|
+
return new channel_1.ForwardingChannel('any', () => toDispose.dispose(), () => {
|
|
106
|
+
const result = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
|
|
107
|
+
// Says only whether the session can carry a message; the buffer decides whether it may
|
|
108
|
+
// go ahead of anything already waiting.
|
|
109
|
+
result.onCommit(buffer => this.framedBuffer.sendOrQueue(this.canSend ? this.socket : undefined, buffer));
|
|
110
|
+
return result;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/** Fires when the buffer runs out of room, so an adopter can say so rather than just stopping. */
|
|
114
|
+
get onBufferOverflow() {
|
|
115
|
+
return this.framedBuffer.onOverflow;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The write buffer Theia injected into the base class.
|
|
119
|
+
*
|
|
120
|
+
* Reached through a structural view rather than as `this.writeBuffer`,
|
|
121
|
+
* because that member is `private` in Theia 1.70 and only became `protected`
|
|
122
|
+
* in 1.71 — and this package compiles against the whole range. The view
|
|
123
|
+
* asserts nothing the versions disagree about: the field is there in both,
|
|
124
|
+
* holding whatever `SocketWriteBuffer` is bound, and the check below is what
|
|
125
|
+
* establishes it is ours.
|
|
126
|
+
*/
|
|
127
|
+
get framedBuffer() {
|
|
128
|
+
const buffer = this.writeBuffer;
|
|
129
|
+
if (!(buffer instanceof framed_socket_write_buffer_1.FramedSocketWriteBuffer)) {
|
|
130
|
+
throw new Error('SessionAwareConnectionSource requires FramedSocketWriteBuffer to be bound');
|
|
131
|
+
}
|
|
132
|
+
return buffer;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
exports.SessionAwareConnectionSource = SessionAwareConnectionSource;
|
|
136
|
+
exports.SessionAwareConnectionSource = SessionAwareConnectionSource = __decorate([
|
|
137
|
+
(0, inversify_1.injectable)()
|
|
138
|
+
], SessionAwareConnectionSource);
|
|
139
|
+
/**
|
|
140
|
+
* Replaces the frontend pieces that decide how outgoing messages survive a
|
|
141
|
+
* reconnect. Every one of them rebinds something Theia's
|
|
142
|
+
* `messagingFrontendModule` already bound, so this belongs in a module loaded
|
|
143
|
+
* into the same container.
|
|
144
|
+
*
|
|
145
|
+
* It must be a `frontendPreload` module rather than a normal frontend module:
|
|
146
|
+
* Theia's preloader resolves `WebSocketConnectionSource` (and with it the write
|
|
147
|
+
* buffer) while loading i18n and OS settings, which happens before any frontend
|
|
148
|
+
* module is loaded. A rebind there would come too late — the instances would
|
|
149
|
+
* already exist. All `frontendPreload` modules, by contrast, are loaded before
|
|
150
|
+
* the preloader constructs anything.
|
|
151
|
+
*
|
|
152
|
+
* Does nothing but warn on a Theia too old to expose the buffer binding, so the
|
|
153
|
+
* package keeps one supported range rather than splitting its floor for this
|
|
154
|
+
* feature. Returns whether the hardening was installed, for an adopter that
|
|
155
|
+
* wants to branch on it.
|
|
156
|
+
*/
|
|
157
|
+
function bindConnectionResilience(isBound, rebind, options = {}) {
|
|
158
|
+
if (!(0, framed_socket_write_buffer_1.supportsConnectionResilience)(isBound)) {
|
|
159
|
+
(0, framed_socket_write_buffer_1.warnConnectionResilienceUnavailable)('frontend');
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
// Scopes are kept as Theia declares them: one buffer per connection source, one shared socket owner.
|
|
163
|
+
rebind(socket_write_buffer_1.SocketWriteBuffer).toDynamicValue(() => (0, framed_socket_write_buffer_1.createFramedSocketWriteBuffer)(options.bufferBytes));
|
|
164
|
+
rebind(ws_connection_source_1.WebSocketConnectionSource).to(SessionAwareConnectionSource).inSingletonScope();
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=session-aware-connection-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-aware-connection-source.js","sourceRoot":"","sources":["../../src/browser/session-aware-connection-source.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AA8JlF,4DAaC;AAzKD,iGAAmG;AACnG,kEAAqF;AAErF,wEAAqG;AACrG,8GAA4H;AAC5H,kGAAsG;AACtG,4DAA2E;AAC3E,8FAAyF;AAEzF,qFAM8C;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,gDAAyB;IACxE;;;;;;OAMG;IACO,cAAc,GAAG,KAAK,CAAC;IACvB,wBAAwB,GAAG,KAAK,CAAC;IAE3C;;;;OAIG;IACgB,qBAAqB;QACrC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,KAAK,CAAC,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAED;;;;;;OAMG;IACO,iBAAiB;QACxB,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACjC,OAAO;QACV,CAAC;QACD,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,oDAA4B,CAAC,eAAe,EAAE,GAAG,EAAE;YAC/D,IAAI,CAAC,cAAc,GAAG,IAAI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|
|
|
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
|
+
/**
|
|
10
|
+
* Options for the `bindConnectionResilience` helper each tier exports.
|
|
11
|
+
*
|
|
12
|
+
* Lives in `common` rather than beside either helper so the server entry can
|
|
13
|
+
* name the type without importing the browser module, and the other way round.
|
|
14
|
+
*/
|
|
15
|
+
export interface ConnectionResilienceOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Size of the buffer holding messages while the socket is down, in bytes.
|
|
18
|
+
* Defaults to Theia's own limit. It decides how long an outage can last
|
|
19
|
+
* before changes start being rejected, so a deployment on a poor network
|
|
20
|
+
* trades memory for tolerance here.
|
|
21
|
+
*/
|
|
22
|
+
readonly bufferBytes?: number;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=connection-resilience-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-resilience-options.d.ts","sourceRoot":"","sources":["../../src/common/connection-resilience-options.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAChC"}
|