-
Couldn't load subscription status.
- Fork 109
Closed
Labels
Feature RequestRequest for new functionality to be added to the driver.Request for new functionality to be added to the driver.
Description
This unit test fails:
it.only('Document updates with revision checking causes conflict', async () => {
const testCount = 10
const db = arangoService.getInstance()
const collection = await db.createCollection('test')
const collectionData = await collection.get()
expect(collectionData.type).toBe(CollectionType.DOCUMENT_COLLECTION)
// Create documents
const created = []
for (let i = 0; i < testCount; i++) {
created.push(await collection.save({ test: 'update-failure', count: 1 }, { returnNew: true }))
}
expect(created).toBeArrayOfObjects()
expect(created).toBeArrayOfSize(testCount)
// Now try to update them
const updated = []
for (const doc of created) {
updated.push(
await collection.update(
doc._id,
{ _rev: doc._rev, updated: true },
{ returnOld: true, returnNew: true, ignoreRevs: false }
)
)
}
expect(updated).toBeArrayOfObjects()
expect(updated).toBeArrayOfSize(testCount)
})The error is:
ArangoError: conflict
at new ArangoError (node_modules/src/error.ts:143:17)
at Object.resolve (node_modules/src/connection.ts:900:20)
at callback (node_modules/src/connection.ts:628:16)
If ignoreRevs is set to true or the _rev property is not provided on the document content, the test passes.
Metadata
Metadata
Assignees
Labels
Feature RequestRequest for new functionality to be added to the driver.Request for new functionality to be added to the driver.