Skip to content

Commit 3b9daa1

Browse files
committed
Correct usage of store.get, it uses a promise to retrieve the object.
1 parent a05f186 commit 3b9daa1

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/simperium/channel.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,11 @@ internal.handleChangeError = function( err, change, acknowledged ) {
199199
case CODE_INVALID_VERSION:
200200
case CODE_INVALID_DIFF: // Invalid version or diff, send full object back to server
201201
if ( ! change.hasSentFullObject ) {
202-
change.d = this.store.get( change.id );
203-
change.hasSentFullObject = true;
204-
this.localQueue.queue( change );
202+
this.store.get( change.id ).then( object => {
203+
change.d = object;
204+
change.hasSentFullObject = true;
205+
this.localQueue.queue( change );
206+
} );
205207
} else {
206208
this.localQueue.dequeueChangesFor( change.id );
207209
}

0 commit comments

Comments
 (0)