Conversation
| var data = { title: 'hola mundo' }; | ||
|
|
||
| channel.on( 'acknowledge', function() { | ||
| channel.once( 'acknowledge', function() { |
There was a problem hiding this comment.
Without this, any future channel.emit('acknowledge') causes a test to error because done is called more than once.
| /** | ||
| * Simulate receiving a 409 | ||
| */ | ||
| channel.handleMessage( 'c:[{"error": 409, "ccids":["dup-ccid"], "id": "mock-id"}]' ); |
There was a problem hiding this comment.
c:[{"clientid":"offending-client","id":"object-key","error":"401","ccids":["abcdef123456"]}]
|
Worth noting in the protocol docs it says:
|
|
|
||
| break; | ||
| case CODE_DUPLICATE_CHANGE: | ||
| internal.updateAcknowledged.call( this, acknowledged ); |
There was a problem hiding this comment.
I left this as a separate case since it carries a different semantic meaning than an empty change
|
Let's |
Unit test to simulate a client receiving a 409 error from the server for a change that originated from the same client.
The fix is intentionally left out which should be as simple as: