Stack overflow resolving a promise returned by the VS Code API
Hi! Thanks for providing Promesa! I totally love it. ♥️
When investigating an issue on Joyride, I noticed that with Promesa versions later than 10.0.594 this function throws an error about exceeding the stack size:
(defn say-clipboard-content! []
(p/let [; text (.then (vscode/env.clipboard.readText) identity) ; works fine
text (vscode/env.clipboard.readText) ; crashes
]
(vscode/window.showInformationMessage (str "clipboard contains: " text))))
As I don't know any other promise that encounters the error, I created a tiny VS Code extension to reproduce: https://github.com/PEZ/promesa-stack-overflow
Let me know if I can help with debugging in any way.
My wild guess would be that this issue is introduced in
In this version, one of the problems that existed since the birth of this library has been corrected, related to the fact that the default implementation of js/Promise makes it impossible to nest promises.
11.0.664
Possibly the VSCode API returns a nested promise and promesa somehow gets stuck in a loop because of this? Again, just a guess..
Thanks for the detailed report and repo repo, I will try to look on it ASAP
Good news, the issue is already fixed on master
I have planning releasing a first RC this week but I can't promise nothing because i have a pretty busy days
Great! I should have tried that! I could confirm with the repro project, which has been updated to say as much.
Out of curiosity, which commit was the fix?
I don't know, but probably some bug on how internal resolution on the custom Promise impl on JS...
In any case, released 12.0.0-RC2 that should have this fix. So closing. If you find something strange with RC2, please report :D
Thanks to all