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

createFunction returns before function is created #3052

Closed
VasuBhog opened this issue Feb 24, 2022 · 5 comments
Closed

createFunction returns before function is created #3052

VasuBhog opened this issue Feb 24, 2022 · 5 comments
Labels
Milestone

Comments

@VasuBhog
Copy link
Contributor

I have been using the createFunction API and found that after the call is made and the user completes the flow. The promise is immediately completed but the function file is not made and therefore any following commands/logic that requires to access the project file, for example, would not work and return undefined.

The createFunction should ensure that the function file is made prior to completing the promise.

The current workaround is to create a watcher to see when a project file or host.json is created from the createFunction.

@alexweininger
Copy link
Member

alexweininger commented Feb 24, 2022

Could you check if this is related to #2908? It seems like a very similar scenario (and both from vscode-mssql irrc).

@VasuBhog
Copy link
Contributor Author

It is similar, however, this seems to be a core issue with how the function returns the promise faster than the function file is actually created. I have been able to repro this many times.

@wwlorey wwlorey added the bug label Feb 24, 2022
@wwlorey
Copy link
Contributor

wwlorey commented Feb 24, 2022

This is likely a problem with the VS Code workspace not being updated by the time they attempt to read host.json. We should use workspace to write the json file instead of fs-extra.

@VasuBhog
Copy link
Contributor Author

VasuBhog commented Mar 1, 2022

@wwlorey and @alexweininger any updates on if this is planned on being fixed/improved?

@nturinski
Copy link
Member

Fixed by #3268

@microsoft microsoft locked and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants