(
result: MatchingStrategy,
)
| 858 | * Process matching strategy and wait for synchronization |
| 859 | */ |
| 860 | const processMatchingStrategy = async ( |
| 861 | result: MatchingStrategy, |
| 862 | ): Promise<void> => { |
| 863 | // Only wait if result contains txid |
| 864 | if (result && `txid` in result) { |
| 865 | const timeout = result.timeout |
| 866 | // Handle both single txid and array of txids |
| 867 | if (Array.isArray(result.txid)) { |
| 868 | await Promise.all(result.txid.map((txid) => awaitTxId(txid, timeout))) |
| 869 | } else { |
| 870 | await awaitTxId(result.txid, timeout) |
| 871 | } |
| 872 | } |
| 873 | // If result is void/undefined, don't wait - mutation completes immediately |
| 874 | } |
| 875 | |
| 876 | // Create wrapper handlers for direct persistence operations that handle different matching strategies |
| 877 | const wrappedOnInsert = config.onInsert |
no test coverage detected