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

DiscoverFromExternalSource setup needs some fixes #211

Open
npm1 opened this issue Jan 12, 2023 · 1 comment
Open

DiscoverFromExternalSource setup needs some fixes #211

npm1 opened this issue Jan 12, 2023 · 1 comment

Comments

@npm1
Copy link
Contributor

npm1 commented Jan 12, 2023

The current setup of DiscoverFromExternalSource seems incorrect. It is invoked from in parallel yet catches exceptions. That's not really a thing. An exception that is used to reject a promise would need to be created from main (not in parallel). So either Discover needs to be invoked from main, or the exception needs to be created outside of Discover.

Besides this, the return value itself of DiscoverFromExternalSource is a Credential. Such an object could only be created from main. Yet the algorithm is invoked from in parallel but with no mention to the globalObject that should be used to create the object.

Based on the above, it is probably best to invoke Discover from main if possible. Since the algorithm is being called from in parallel, that would involve a task. Alternatively, the algorithm needs to receive the execution context, and needs to receive as return value an object which can be either a Credential or an exception object (not sure if exception being propagated upwards is a thing while in parallel).

@npm1
Copy link
Contributor Author

npm1 commented Jan 12, 2023

Hm given that Discover can be complex, I think keeping it being invoked from in parallel but providing the relevant fixes is the best solution.

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

No branches or pull requests

1 participant