Open History to see the last commit
1import { assert, describe, it } from "@effect/vitest";
2import type {
3 DesktopTelemetryRequestDesktopUpdate,
4 DesktopTelemetryCommitDesktopUpdate,
5 DesktopTelemetryCancelDesktopUpdate,
6 DesktopUpdateStatusReport,
7} from "@t3tools/contracts";
8import * as Deferred from "effect/Deferred";
9import * as Duration from "effect/Duration";
10import * as Effect from "effect/Effect";
11import * as Fiber from "effect/Fiber";
12import * as Layer from "effect/Layer";
13import * as Queue from "effect/Queue";
14import * as Ref from "effect/Ref";
15import * as Stream from "effect/Stream";
16import * as TestClock from "effect/testing/TestClock";
17
18import * as ElectronUpdater from "../electron/ElectronUpdater.ts";
19import * as DesktopState from "../app/DesktopState.ts";
20import * as DesktopTelemetryPublisher from "../telemetry/DesktopTelemetryPublisher.ts";
21import * as DesktopRemoteUpdates from "./DesktopRemoteUpdates.ts";
22import * as DesktopUpdates from "./DesktopUpdates.ts";
23import { makeHarness } from "./updatesTestHarness.ts";
24
25// The remote flow hops between the test runtime's fibers and the updater's
26// runPromise-driven event handlers, so settling needs real microtask turns,
27// not just fiber yields.
28const settle = Effect.gen(function* () {
29 for (let i = 0; i < 20; i += 1) {
30 yield* Effect.yieldNow;
31 yield* Effect.promise(() => Promise.resolve());
32 }
33});
34
35const request = (requestId: string): DesktopTelemetryRequestDesktopUpdate => ({
36 version: 1,
37 type: "requestDesktopUpdate",
38 requestId,
39});
40
41function runRemoteUpdatesTest(
42 harness: ReturnType<typeof makeHarness>,
43 body: (context: {
44 readonly reports: DesktopUpdateStatusReport[];
45 readonly requests: Queue.Queue<DesktopTelemetryRequestDesktopUpdate>;
46 readonly commits: Queue.Queue<DesktopTelemetryCommitDesktopUpdate>;
47 readonly cancellations: Queue.Queue<DesktopTelemetryCancelDesktopUpdate>;
48 }) => Effect.Effect<void, never, DesktopUpdates.DesktopUpdates | DesktopState.DesktopState>,
49) {
50 return Effect.scoped(
51 Effect.gen(function* () {
52 const requests = yield* Queue.unbounded<DesktopTelemetryRequestDesktopUpdate>();
53 const commits = yield* Queue.unbounded<DesktopTelemetryCommitDesktopUpdate>();
54 const cancellations = yield* Queue.unbounded<DesktopTelemetryCancelDesktopUpdate>();
55 const reports: DesktopUpdateStatusReport[] = [];
56 const publisher = DesktopTelemetryPublisher.DesktopTelemetryPublisher.of({
57 latest: Effect.succeedNone,
58 changes: Stream.empty,
59 encoded: Stream.empty,
60 handleControlForSource: () => Effect.void,
61 removeControlSource: () => Effect.void,
62 publishUpdateReport: (report) =>
63 Effect.sync(() => {
64 reports.push(report);
65 }),
66 updateRequests: Stream.fromQueue(requests),
67 updateCommits: Stream.fromQueue(commits),
68 updateCancellations: Stream.fromQueue(cancellations),
69 });
70
71 const updates = yield* DesktopUpdates.DesktopUpdates;
72 yield* updates.configure;
73 yield* DesktopRemoteUpdates.listen.pipe(
74 Effect.provideService(DesktopTelemetryPublisher.DesktopTelemetryPublisher, publisher),
75 );
76 yield* settle;
77 yield* body({ reports, requests, commits, cancellations });
78 }),
79 ).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
80}
81
82function terminalReports(reports: DesktopUpdateStatusReport[]): DesktopUpdateStatusReport[] {
83 return reports.filter((report) => report.outcome !== undefined);
84}
85
86describe("DesktopRemoteUpdates", () => {
87 it.effect("drives check, download, and install with no local confirmation", () => {
88 const harness = makeHarness();
89
90 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
91 Effect.gen(function* () {
92 yield* Queue.offer(requests, request("req-1"));
93 yield* settle;
94 assert.equal(harness.checkCount(), 1);
95
96 harness.emit("update-available", { version: "1.2.4" });
97 yield* settle;
98 harness.emit("update-downloaded", { version: "1.2.4" });
99 yield* settle;
100
101 const terminals = terminalReports(reports);
102 assert.equal(terminals.length, 1);
103 assert.equal(terminals[0]?.outcome, "ready-to-install");
104 assert.equal(terminals[0]?.requestId, "req-1");
105 assert.equal(harness.quitAndInstalls(), 0);
106
107 yield* Queue.offer(commits, {
108 version: 1,
109 type: "commitDesktopUpdate",
110 requestId: "req-1",
111 });
112 yield* settle;
113 assert.equal(harness.quitAndInstalls(), 1);
114
115 const statuses = reports
116 .filter((report) => report.requestId === "req-1")
117 .map((report) => report.state.status);
118 assert.include(statuses, "available");
119 assert.include(statuses, "downloaded");
120 }),
121 );
122 });
123
124 it.effect("reports a failed outcome when quitAndInstall fails", () => {
125 const harness = makeHarness({
126 quitAndInstall: Effect.fail(
127 new ElectronUpdater.ElectronUpdaterQuitAndInstallError({
128 channel: "latest",
129 isSilent: true,
130 isForceRunAfter: true,
131 cause: new Error("spawn failed"),
132 }),
133 ),
134 });
135
136 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
137 Effect.gen(function* () {
138 yield* Queue.offer(requests, request("req-4"));
139 yield* settle;
140 harness.emit("update-available", { version: "1.2.4" });
141 yield* settle;
142 harness.emit("update-downloaded", { version: "1.2.4" });
143 yield* settle;
144
145 yield* Queue.offer(commits, {
146 version: 1,
147 type: "commitDesktopUpdate",
148 requestId: "req-4",
149 });
150 yield* settle;
151
152 const terminals = terminalReports(reports);
153 assert.deepEqual(
154 terminals.map((report) => report.outcome),
155 ["ready-to-install", "failed"],
156 );
157 assert.equal(terminals[1]?.state.errorContext, "install");
158 }),
159 );
160 });
161
162 it.effect("joins an in-progress install on commit instead of failing the token", () => {
163 const installStarted = Deferred.makeUnsafe<void>();
164 const releaseInstall = Deferred.makeUnsafe<void>();
165 const harness = makeHarness({
166 stopBackend: Deferred.succeed(installStarted, undefined).pipe(
167 Effect.andThen(Deferred.await(releaseInstall)),
168 ),
169 });
170
171 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
172 Effect.gen(function* () {
173 const updates = yield* DesktopUpdates.DesktopUpdates;
174 yield* Queue.offer(requests, request("req-join-commit"));
175 yield* settle;
176 harness.emit("update-available", { version: "1.2.4" });
177 yield* settle;
178 harness.emit("update-downloaded", { version: "1.2.4" });
179 yield* settle;
180 assert.deepEqual(
181 terminalReports(reports).map((report) => report.outcome),
182 ["ready-to-install"],
183 );
184
185 const localInstall = yield* updates.install.pipe(Effect.forkChild);
186 yield* Deferred.await(installStarted);
187 yield* Queue.offer(commits, {
188 version: 1,
189 type: "commitDesktopUpdate",
190 requestId: "req-join-commit",
191 });
192 yield* settle;
193
194 assert.deepEqual(
195 terminalReports(reports).map((report) => report.outcome),
196 ["ready-to-install"],
197 );
198 assert.equal(harness.quitAndInstalls(), 0);
199
200 yield* Deferred.succeed(releaseInstall, undefined);
201 yield* Fiber.join(localInstall);
202 }),
203 );
204 });
205
206 it.effect("does not join a normal app quit as an update install", () => {
207 const harness = makeHarness();
208
209 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
210 Effect.gen(function* () {
211 const desktopState = yield* DesktopState.DesktopState;
212 yield* Queue.offer(requests, request("req-normal-quit"));
213 yield* settle;
214 harness.emit("update-available", { version: "1.2.4" });
215 yield* settle;
216 harness.emit("update-downloaded", { version: "1.2.4" });
217 yield* settle;
218
219 yield* Ref.set(desktopState.quitting, true);
220 yield* Queue.offer(commits, {
221 version: 1,
222 type: "commitDesktopUpdate",
223 requestId: "req-normal-quit",
224 });
225 yield* settle;
226
227 assert.deepEqual(
228 terminalReports(reports).map((report) => report.outcome),
229 ["ready-to-install", "failed"],
230 );
231 assert.equal(harness.quitAndInstalls(), 0);
232 }),
233 );
234 });
235
236 it.effect("does not misread a lingering install error as a failed retry", () => {
237 let installAttempts = 0;
238 const harness = makeHarness({
239 quitAndInstall: Effect.suspend(() => {
240 installAttempts += 1;
241 return installAttempts === 1
242 ? Effect.fail(
243 new ElectronUpdater.ElectronUpdaterQuitAndInstallError({
244 channel: "latest",
245 isSilent: true,
246 isForceRunAfter: true,
247 cause: new Error("first attempt failed"),
248 }),
249 )
250 : Effect.void;
251 }),
252 });
253
254 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
255 Effect.gen(function* () {
256 yield* Queue.offer(requests, request("req-5"));
257 yield* settle;
258 harness.emit("update-available", { version: "1.2.4" });
259 yield* settle;
260 harness.emit("update-downloaded", { version: "1.2.4" });
261 yield* settle;
262 yield* Queue.offer(commits, {
263 version: 1,
264 type: "commitDesktopUpdate",
265 requestId: "req-5",
266 });
267 yield* settle;
268 yield* Queue.offer(requests, request("req-6"));
269 yield* settle;
270 yield* Queue.offer(commits, {
271 version: 1,
272 type: "commitDesktopUpdate",
273 requestId: "req-6",
274 });
275 yield* settle;
276
277 const retryTerminals = terminalReports(reports).filter(
278 (report) => report.requestId === "req-6",
279 );
280 assert.deepEqual(
281 retryTerminals.map((report) => report.outcome),
282 ["ready-to-install"],
283 );
284 assert.equal(harness.quitAndInstalls(), 2);
285 }),
286 );
287 });
288
289 it.effect("ignores an unrelated updater event while an install is starting", () => {
290 const stopStarted = Deferred.makeUnsafe<void>();
291 const releaseStop = Deferred.makeUnsafe<void>();
292 const harness = makeHarness({
293 stopBackend: Deferred.succeed(stopStarted, undefined).pipe(
294 Effect.andThen(Deferred.await(releaseStop)),
295 ),
296 });
297
298 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
299 Effect.gen(function* () {
300 yield* Queue.offer(requests, request("req-late-event"));
301 yield* settle;
302 harness.emit("update-available", { version: "1.2.4" });
303 yield* settle;
304 harness.emit("update-downloaded", { version: "1.2.4" });
305 yield* settle;
306
307 yield* Queue.offer(commits, {
308 version: 1,
309 type: "commitDesktopUpdate",
310 requestId: "req-late-event",
311 });
312 yield* Deferred.await(stopStarted);
313 harness.emit("download-progress", { percent: 90 });
314 yield* settle;
315 yield* Deferred.succeed(releaseStop, undefined);
316 yield* settle;
317
318 assert.deepEqual(
319 terminalReports(reports)
320 .filter((report) => report.requestId === "req-late-event")
321 .map((report) => report.outcome),
322 ["ready-to-install"],
323 );
324 }),
325 );
326 });
327
328 it.effect("retries a download refused while the check still holds the reservation", () => {
329 // electron-updater emits update-available from inside checkForUpdates,
330 // before the check action releases its reservation.
331 const releaseCheck = Deferred.makeUnsafe<void>();
332 const harness = makeHarness({ checkForUpdates: Deferred.await(releaseCheck) });
333
334 return runRemoteUpdatesTest(harness, ({ reports, requests }) =>
335 Effect.gen(function* () {
336 yield* Queue.offer(requests, request("req-8"));
337 yield* settle;
338 assert.equal(harness.checkCount(), 1);
339
340 harness.emit("update-available", { version: "1.2.4" });
341 yield* settle;
342 assert.equal(harness.downloadCount(), 0);
343
344 yield* Deferred.succeed(releaseCheck, undefined);
345 yield* settle;
346 yield* TestClock.adjust(Duration.millis(300));
347 yield* settle;
348 assert.equal(harness.downloadCount(), 1);
349
350 harness.emit("update-downloaded", { version: "1.2.4" });
351 yield* settle;
352 assert.deepEqual(
353 terminalReports(reports).map((report) => report.outcome),
354 ["ready-to-install"],
355 );
356 assert.equal(harness.quitAndInstalls(), 0);
357 }),
358 );
359 });
360
361 it.effect("waits for the download reservation before reporting prepared", () => {
362 // update-downloaded fires from inside downloadUpdate. If the flow
363 // reported "installing" right then, install would be refused for the
364 // held reservation after the irrevocable terminal already went out.
365 const releaseDownload = Deferred.makeUnsafe<void>();
366 const harness = makeHarness({ downloadUpdate: Deferred.await(releaseDownload) });
367
368 return runRemoteUpdatesTest(harness, ({ reports, requests }) =>
369 Effect.gen(function* () {
370 yield* Queue.offer(requests, request("req-10"));
371 yield* settle;
372 harness.emit("update-available", { version: "1.2.4" });
373 yield* settle;
374 harness.emit("update-downloaded", { version: "1.2.4" });
375 yield* settle;
376 assert.deepEqual(terminalReports(reports), []);
377 assert.equal(harness.quitAndInstalls(), 0);
378
379 yield* Deferred.succeed(releaseDownload, undefined);
380 yield* settle;
381 yield* TestClock.adjust(Duration.millis(300));
382 yield* settle;
383 assert.deepEqual(
384 terminalReports(reports).map((report) => report.outcome),
385 ["ready-to-install"],
386 );
387 assert.equal(harness.quitAndInstalls(), 0);
388 }),
389 );
390 });
391
392 it.effect("joins an install that is already tearing the app down", () => {
393 const harness = makeHarness();
394
395 return runRemoteUpdatesTest(harness, ({ reports, requests }) =>
396 Effect.gen(function* () {
397 const desktopState = yield* DesktopState.DesktopState;
398 harness.emit("update-downloaded", { version: "1.2.4" });
399 yield* settle;
400 yield* Ref.set(desktopState.quitting, true);
401
402 yield* Queue.offer(requests, request("req-9"));
403 yield* settle;
404
405 assert.deepEqual(
406 terminalReports(reports).map((report) => report.outcome),
407 ["ready-to-install"],
408 );
409 assert.equal(harness.quitAndInstalls(), 0);
410 }),
411 );
412 });
413
414 it.effect("does not run the installer twice for a repeated commit", () => {
415 const harness = makeHarness();
416
417 return runRemoteUpdatesTest(harness, ({ requests, commits }) =>
418 Effect.gen(function* () {
419 yield* Queue.offer(requests, request("req-repeat"));
420 yield* settle;
421 harness.emit("update-available", { version: "1.2.4" });
422 yield* settle;
423 harness.emit("update-downloaded", { version: "1.2.4" });
424 yield* settle;
425
426 const commit = {
427 version: 1,
428 type: "commitDesktopUpdate",
429 requestId: "req-repeat",
430 } as const;
431 yield* Queue.offer(commits, commit);
432 yield* settle;
433 yield* Queue.offer(commits, commit);
434 yield* settle;
435
436 assert.equal(harness.quitAndInstalls(), 1);
437 }),
438 );
439 });
440
441 it.effect("waits for a background check before installing a prepared update", () => {
442 const backgroundCheckStarted = Deferred.makeUnsafe<void>();
443 const releaseBackgroundCheck = Deferred.makeUnsafe<void>();
444 let checks = 0;
445 const harness = makeHarness({
446 checkForUpdates: Effect.suspend(() => {
447 checks += 1;
448 return checks === 2
449 ? Deferred.succeed(backgroundCheckStarted, undefined).pipe(
450 Effect.andThen(Deferred.await(releaseBackgroundCheck)),
451 )
452 : Effect.void;
453 }),
454 });
455
456 return runRemoteUpdatesTest(harness, ({ requests, commits }) =>
457 Effect.gen(function* () {
458 const updates = yield* DesktopUpdates.DesktopUpdates;
459 yield* Queue.offer(requests, request("req-background-check"));
460 yield* settle;
461 harness.emit("update-available", { version: "1.2.4" });
462 yield* settle;
463 harness.emit("update-downloaded", { version: "1.2.4" });
464 yield* settle;
465
466 const backgroundCheck = yield* updates.check("poll").pipe(Effect.forkChild);
467 yield* Deferred.await(backgroundCheckStarted);
468 assert.equal((yield* updates.getState).status, "checking");
469
470 yield* Queue.offer(commits, {
471 version: 1,
472 type: "commitDesktopUpdate",
473 requestId: "req-background-check",
474 });
475 yield* settle;
476 assert.equal(harness.quitAndInstalls(), 0);
477
478 harness.emit("update-downloaded", { version: "1.2.4" });
479 yield* Deferred.succeed(releaseBackgroundCheck, undefined);
480 yield* Fiber.join(backgroundCheck);
481 yield* settle;
482 assert.equal(harness.quitAndInstalls(), 1);
483 }),
484 );
485 });
486
487 it.effect("rejects a new preparation while an install commit is active", () => {
488 const installStarted = Deferred.makeUnsafe<void>();
489 const releaseInstall = Deferred.makeUnsafe<void>();
490 const harness = makeHarness({
491 quitAndInstall: Deferred.succeed(installStarted, undefined).pipe(
492 Effect.andThen(Deferred.await(releaseInstall)),
493 Effect.andThen(
494 Effect.fail(
495 new ElectronUpdater.ElectronUpdaterQuitAndInstallError({
496 channel: "latest",
497 isSilent: true,
498 isForceRunAfter: true,
499 cause: new Error("installer refused"),
500 }),
501 ),
502 ),
503 ),
504 });
505
506 return runRemoteUpdatesTest(harness, ({ reports, requests, commits }) =>
507 Effect.gen(function* () {
508 yield* Queue.offer(requests, request("req-active"));
509 yield* settle;
510 harness.emit("update-available", { version: "1.2.4" });
511 yield* settle;
512 harness.emit("update-downloaded", { version: "1.2.4" });
513 yield* settle;
514 yield* Queue.offer(commits, {
515 version: 1,
516 type: "commitDesktopUpdate",
517 requestId: "req-active",
518 });
519 yield* Deferred.await(installStarted);
520
521 yield* Queue.offer(requests, request("req-overlap"));
522 yield* settle;
523 const overlap = terminalReports(reports).find(
524 (report) => report.requestId === "req-overlap",
525 );
526 assert.equal(overlap?.outcome, "failed");
527 assert.equal(overlap?.reason, "A prepared desktop update is already in progress.");
528
529 yield* Deferred.succeed(releaseInstall, undefined);
530 yield* settle;
531 }),
532 );
533 });
534
535 it.effect("cancels an active preparation so the next request can run", () => {
536 const releaseCheck = Deferred.makeUnsafe<void>();
537 const harness = makeHarness({ checkForUpdates: Deferred.await(releaseCheck) });
538
539 return runRemoteUpdatesTest(harness, ({ requests, cancellations }) =>
540 Effect.gen(function* () {
541 yield* Queue.offer(requests, request("req-cancel"));
542 yield* settle;
543 yield* Queue.offer(cancellations, {
544 version: 1,
545 type: "cancelDesktopUpdate",
546 requestId: "req-cancel",
547 });
548 yield* settle;
549 yield* Deferred.succeed(releaseCheck, undefined);
550 yield* Queue.offer(requests, request("req-next"));
551 yield* settle;
552
553 assert.equal(harness.checkCount(), 2);
554 }),
555 );
556 });
557
558 it.effect("remembers a cancellation that arrives before its request starts", () => {
559 const harness = makeHarness();
560
561 return runRemoteUpdatesTest(harness, ({ requests, cancellations }) =>
562 Effect.gen(function* () {
563 yield* Queue.offer(cancellations, {
564 version: 1,
565 type: "cancelDesktopUpdate",
566 requestId: "req-early-cancel",
567 });
568 yield* Queue.offer(requests, request("req-early-cancel"));
569 yield* settle;
570
571 assert.equal(harness.checkCount(), 0);
572
573 yield* Queue.offer(requests, request("req-after-early-cancel"));
574 yield* settle;
575 assert.equal(harness.checkCount(), 1);
576 }),
577 );
578 });
579
580 it.effect("does not install after cancellation wins the commit claim", () => {
581 const harness = makeHarness();
582
583 return runRemoteUpdatesTest(harness, ({ reports, requests, commits, cancellations }) =>
584 Effect.gen(function* () {
585 yield* Queue.offer(requests, request("req-cancel-before-commit"));
586 yield* settle;
587 harness.emit("update-available", { version: "1.2.4" });
588 yield* settle;
589 harness.emit("update-downloaded", { version: "1.2.4" });
590 yield* settle;
591
592 yield* Queue.offer(cancellations, {
593 version: 1,
594 type: "cancelDesktopUpdate",
595 requestId: "req-cancel-before-commit",
596 });
597 yield* settle;
598 yield* Queue.offer(commits, {
599 version: 1,
600 type: "commitDesktopUpdate",
601 requestId: "req-cancel-before-commit",
602 });
603 yield* settle;
604
605 assert.equal(harness.quitAndInstalls(), 0);
606 assert.deepEqual(
607 terminalReports(reports)
608 .filter((report) => report.requestId === "req-cancel-before-commit")
609 .map((report) => report.outcome),
610 ["ready-to-install", "failed"],
611 );
612 }),
613 );
614 });
615
616 it.effect("retains an install failure after cancellation loses the commit claim", () => {
617 const installStarted = Deferred.makeUnsafe<void>();
618 const releaseInstall = Deferred.makeUnsafe<void>();
619 const harness = makeHarness({
620 quitAndInstall: Deferred.succeed(installStarted, undefined).pipe(
621 Effect.andThen(Deferred.await(releaseInstall)),
622 Effect.andThen(
623 Effect.fail(
624 new ElectronUpdater.ElectronUpdaterQuitAndInstallError({
625 channel: "latest",
626 isSilent: true,
627 isForceRunAfter: true,
628 cause: new Error("installer refused"),
629 }),
630 ),
631 ),
632 ),
633 });
634
635 return runRemoteUpdatesTest(harness, ({ reports, requests, commits, cancellations }) =>
636 Effect.gen(function* () {
637 yield* Queue.offer(requests, request("req-cancel-after-commit"));
638 yield* settle;
639 harness.emit("update-available", { version: "1.2.4" });
640 yield* settle;
641 harness.emit("update-downloaded", { version: "1.2.4" });
642 yield* settle;
643 const commit = {
644 version: 1,
645 type: "commitDesktopUpdate",
646 requestId: "req-cancel-after-commit",
647 } as const;
648 yield* Queue.offer(commits, commit);
649 yield* Deferred.await(installStarted);
650 yield* Queue.offer(cancellations, {
651 version: 1,
652 type: "cancelDesktopUpdate",
653 requestId: "req-cancel-after-commit",
654 });
655 yield* settle;
656 yield* Deferred.succeed(releaseInstall, undefined);
657 yield* settle;
658 yield* Queue.offer(commits, commit);
659 yield* settle;
660
661 assert.deepEqual(
662 terminalReports(reports)
663 .filter((report) => report.requestId === "req-cancel-after-commit")
664 .map((report) => report.outcome),
665 ["ready-to-install", "failed", "failed"],
666 );
667 }),
668 );
669 });
670
671 it.effect("reports up-to-date without installing when there is no update", () => {
672 const harness = makeHarness();
673
674 return runRemoteUpdatesTest(harness, ({ reports, requests }) =>
675 Effect.gen(function* () {
676 yield* Queue.offer(requests, request("req-2"));
677 yield* settle;
678 harness.emit("update-not-available");
679 yield* settle;
680
681 const terminals = terminalReports(reports);
682 assert.equal(terminals.length, 1);
683 assert.equal(terminals[0]?.outcome, "up-to-date");
684 assert.equal(terminals[0]?.requestId, "req-2");
685 assert.equal(harness.quitAndInstalls(), 0);
686 }),
687 );
688 });
689});