(doc: MessageDoc, now: number)
| 414 | ) |
| 415 | |
| 416 | const claimMessageRead = (doc: MessageDoc, now: number) => |
| 417 | Effect |
| 418 | .tryPromise(() => |
| 419 | container.item(doc.id, doc._partitionKey).patch<MessageDoc>( |
| 420 | [{ op: "set", path: "/lastRead", value: now }], |
| 421 | { accessCondition: { type: "IfMatch", condition: doc._etag ?? "" } } |
| 422 | ) |
| 423 | ) |
| 424 | .pipe( |
| 425 | Effect.tap(annotateItem), |
| 426 | Effect.as(true), |
| 427 | Effect.catchIf(isPreconditionFailed, () => Effect.succeed(false)) |
| 428 | ) |
| 429 | |
| 430 | const batchDocs = <A extends { readonly id: string; readonly _partitionKey: string }>( |
| 431 | docs: ReadonlyArray<A>, |
no test coverage detected
searching dependent graphs…