Skip to content

Commit

Permalink
fix: perform occurrence POST write async (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones authored Aug 1, 2022
1 parent f411e52 commit acbb257
Show file tree
Hide file tree
Showing 4 changed files with 533 additions and 400 deletions.
7 changes: 6 additions & 1 deletion src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ function Api(options, transport, urllib, truncation, jsonBackup) {
Api.prototype.postItem = function(data, callback) {
var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');
var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);
this.transport.post(this.accessToken, transportOptions, payload, callback);
var self = this;

// ensure the network request is scheduled after the current tick.
setTimeout(function() {
self.transport.post(self.accessToken, transportOptions, payload, callback);
}, 0);
};

/**
Expand Down
Loading

0 comments on commit acbb257

Please sign in to comment.