(id?: string)
| 555 | // span on the configured observer, tagged with the resolved |
| 556 | // backend id and the entry count. |
| 557 | push(id?: string): Promise<number> { |
| 558 | return this.#serialize(id, (resolvedId) => |
| 559 | withSpan( |
| 560 | this.#observer, |
| 561 | "workspace.sync.push", |
| 562 | { "workspace.sync.backend": resolvedId }, |
| 563 | async () => { |
| 564 | if (resolvedId === undefined || this.#moduleBackendsById.has(resolvedId)) return 0; |
| 565 | const handle = await this.#handleFor(resolvedId); |
| 566 | // A backend that reuses the host store as its sole |
| 567 | // source of truth has nothing to ship and no remote to |
| 568 | // ship to. Short-circuit so the shell exec bracket can |
| 569 | // keep calling push() unconditionally without paying |
| 570 | // for it. |
| 571 | if (handle.sync === "none") return 0; |
| 572 | return this.#runWithInvalidation(resolvedId, handle, () => |
| 573 | pushOnce(this.#db, handle.rpc.sync, resolvedId), |
| 574 | ); |
| 575 | }, |
| 576 | (span, outcome) => { |
| 577 | if (outcome.ok) span.setAttribute("workspace.sync.pushed", outcome.value); |
| 578 | }, |
| 579 | ), |
| 580 | ); |
| 581 | } |
| 582 | |
| 583 | pull(id?: string): Promise<ApplyResult> { |
| 584 | return this.#serialize(id, (resolvedId) => this.#pullResolved(resolvedId)); |
no test coverage detected