Skip to content

Commit

Permalink
test: fixing write ack tests and submodule dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
yasserf committed Apr 8, 2017
1 parent 83e796f commit 0544558
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/record/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ Record.prototype.set = function (pathOrData, dataOrCallback, callback) {

if (oldValue === newValue) {
if (typeof callback === 'function') {
if (this._client.getConnectionState() === C.CONNECTION_STATE.OPEN) {
utils.requestIdleCallback(callback)
} else {
utils.requestIdleCallback(
callback.bind(this, 'Connection error: error updating record as connection was closed')
)
let errorMessage = null
if (this._client.getConnectionState() !== C.CONNECTION_STATE.OPEN) {
errorMessage = 'Connection error: error updating record as connection was closed'
}
utils.requestIdleCallback(() => callback(errorMessage))
}
return this
}
Expand All @@ -186,7 +184,7 @@ Record.prototype.set = function (pathOrData, dataOrCallback, callback) {
config.writeSuccess = true
if (this._client.getConnectionState() !== C.CONNECTION_STATE.OPEN) {
utils.requestIdleCallback(
callback.bind(this, 'Connection error: error updating record as connection was closed')
() => callback('Connection error: error updating record as connection was closed')
)
} else {
this._setUpCallback(this.version, callback)
Expand Down
2 changes: 1 addition & 1 deletion test-e2e/features
2 changes: 1 addition & 1 deletion test-specs/features

0 comments on commit 0544558

Please sign in to comment.