Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Race condition in loadAdapter(). #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed: Race condition in loadAdapter(). #39

wants to merge 1 commit into from

Conversation

johansten
Copy link

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
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