Skip to content

Commit 3952540

Browse files
committed
Fix race condition in API request chain resolution by immediately resolving current promise before checking chain entry
- items are sometimes queued idefinetely
1 parent 6e21b52 commit 3952540

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎apps/editor/src/services/api-manager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ export class ApiManager {
152152
} finally {
153153
// Unblock anyone waiting for this request if it was the one in the chain
154154
if (!is_chain_resolution_scheduled) {
155+
resolve_current()
155156
const chain_entry = this.waiting_chain.get(params.endpoint_url)
156157
if (chain_entry && chain_entry.resolve === resolve_current) {
157-
chain_entry.resolve()
158158
this.waiting_chain.delete(params.endpoint_url)
159159
}
160160
}

0 commit comments

Comments
 (0)