Skip to content

Function: isDependantChangedConcurrently()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / isDependantChangedConcurrently

Function: isDependantChangedConcurrently()

Section titled “Function: isDependantChangedConcurrently()”

isDependantChangedConcurrently(error): error is ConstraintViolationError

Defined in: src/errors.ts:368

Whether error is the refusal of a write whose dependant another writer changed after the write judged it (reasoninglayer#1245, #1251).

unknown

Anything caught from an SDK call.

error is ConstraintViolationError

true when error is a ConstraintViolationError whose code is dependant_changed_concurrently; false otherwise.

The body is the coded { error, code, message, refs }: refs.dependant names the changed term (read it with errorBodyRefs), and ConstraintViolationError.termId is undefined. Nothing is written. Retry the write: the engine judges the term again. The same doors as isDependantsExceedCommitBudget answer it.

try {
await client.terms.updateTerm(accountId, { features: { limit: 3 } });
} catch (e) {
if (isDependantChangedConcurrently(e)) retry();
}