Skip to content

Fixed: Race condition in loadAdapter(). - #39

Open
johansten wants to merge 1 commit into
borismus:masterfrom
johansten:master
Open

Fixed: Race condition in loadAdapter().#39
johansten wants to merge 1 commit into
borismus:masterfrom
johansten:master

Conversation

@johansten

Copy link
Copy Markdown

Multiple semi-simultaneous calls to loadAdapter add their own script nodes, and the callbacks sometimes ends up not being called in the order intended. This fix makes sure that there is only ONE script-node per adapter, and adds the callbacks to that node. The event handler appears to call the callbacks in the order they were added to the node, so the initial problem of out-of-order callbacks (calling callback in authorize() before callback in OAuth(), and therefore getting bogus parameters to the OAuth2-tab) is gone.

Multiple semi-simultaneous calls to loadAdapter add their own script nodes, and the callbacks sometimes ends up not being called in the order intended. This fix makes sure that there is only ONE script-node per adapter, and adds the callbacks to that node. The event handler appears to call the callbacks in the order they were added to the node, so the initial problem of out-of-order callbacks (calling callback in authorize() before callback in OAuth(), and therefore getting bogus parameters to the OAuth2-tab) is gone.
@johansten

Copy link
Copy Markdown
Author

This of course also fixes issue #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant