Skip to content

Commit

Permalink
fix: snapshots handled by record handler even if they exist locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Harley authored and yasserf committed May 29, 2017
1 parent 5b04616 commit 6e2bdf0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/record/record-handler.js
Expand Up @@ -355,19 +355,21 @@ RecordHandler.prototype._$handle = function (message) {

let processed = false

if (this._records[name]) {
const record = this._records[name]
if (record) {
processed = true
this._records[name]._$onMessage(message)
record._$onMessage(message)
}

} else if (message.action === C.ACTIONS.READ && this._snapshotRegistry.hasRequest(name)) {
if (message.action === C.ACTIONS.READ && this._snapshotRegistry.hasRequest(name)) {
processed = true
this._snapshotRegistry.recieve(name, null, JSON.parse(message.data[2]))

} else if (message.action === C.ACTIONS.HAS && this._hasRegistry.hasRequest(name)) {
processed = true
this._hasRegistry.recieve(name, null, messageParser.convertTyped(message.data[1]))

} else if (message.action === C.ACTIONS.WRITE_ACKNOWLEDGEMENT) {
} else if (message.action === C.ACTIONS.WRITE_ACKNOWLEDGEMENT && !record) {
processed = true
Record._handleWriteAcknowledgements(message, this._writeCallbacks[name], this._client)

Expand Down

0 comments on commit 6e2bdf0

Please sign in to comment.