-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to update a document with revision comparison in 7.2.0 causes conflict #707
Comments
I have also tried with a single document update which also fails with the same error: it.only('Document update with revision checking causes conflict', async () => {
const db = arangoService.getInstance()
const collection = await db.createCollection('test')
const collectionData = await collection.get()
expect(collectionData.type).toBe(CollectionType.DOCUMENT_COLLECTION)
// Create document
const created = await collection.save({ test: 'update-failure' }, { returnNew: true })
expect(created).toBeNonEmptyObject()
expect(created._id).toBeNonEmptyString()
expect(created._rev).toBeNonEmptyString()
expect(created.new.test).toBe('update-failure')
expect(created.new.updated).toBeFalsy()
// Now try to update
const updated = await collection.update(
created._id,
{ _rev: created._rev, updated: true },
{ returnOld: true, returnNew: true, ignoreRevs: false }
)
expect(updated).toBeNonEmptyObject()
expect(updated._id).toBe(created._id)
expect(updated._rev).not.toBe(created._rev)
expect(updated.new.test).toBe(created.new.test)
expect(updated.new.updated).toBeTruthy()
}) Failure:
|
With the old driver where
However, with the new API, there is no
I have attached two Wireshark PCAP captures showing the difference between the two drivers using effectively the same unit test. |
Looks like the HTTP API docs are incorrect or misleading. It's probably easiest to restore the |
My only issue with calling it |
FYI, underlying Arango bug (arangodb/arangodb#13232) is confirmed. |
The server-side issue is fixed in 3.6.12 and 3.7.7, but it may still be desirable to have a driver-side workaround for earlier versions. |
@Simran-B, trying to plan for our own projects. Any idea if/when a "driver-side workaround for earlier versions" might be implemented? |
@Simran-B, I'm trying to figure out if this change now makes the ArangoJS 7.x driver incompatible with older servers. This would appear to be the case as attempting to put |
@Simran-B, looks like this only fails on servers earlier than 3.6.12 so that may well be what you mean by:
I wasn't expecting it to fail outright on earlier versions now. |
@Simran-B here are some wireshark captures of the update HTTP PATCH calls to compare responses from a 3.7.9, 3.6.12 and 3.6.5 server. |
@Simran-B, just noticed workaround hinted at in arangodb/arangodb#13232 (comment). Adding the |
This unit test fails:
The error is:
If
ignoreRevs
is set totrue
or the_rev
property is not provided on the document content, the test passes.The text was updated successfully, but these errors were encountered: