(
id: string | undefined,
fn: (resolvedId: string | undefined) => Promise<T>,
)
| 719 | // the queue — the caller still sees the original rejection |
| 720 | // through the returned promise. |
| 721 | #serialize<T>( |
| 722 | id: string | undefined, |
| 723 | fn: (resolvedId: string | undefined) => Promise<T>, |
| 724 | ): Promise<T> { |
| 725 | const resolved = this.#resolveBackendId(id); |
| 726 | const slot = resolved ?? ""; |
| 727 | const tail = this.#mutationTails.get(slot) ?? Promise.resolve(); |
| 728 | const run = tail.then( |
| 729 | () => fn(resolved), |
| 730 | () => fn(resolved), |
| 731 | ); |
| 732 | this.#mutationTails.set( |
| 733 | slot, |
| 734 | run.then( |
| 735 | () => undefined, |
| 736 | () => undefined, |
| 737 | ), |
| 738 | ); |
| 739 | return run; |
| 740 | } |
| 741 | |
| 742 | // Resolve an exec / push / pull caller's id argument to a |
| 743 | // concrete backend id. Returns undefined for a filesystem-only |
no test coverage detected