[Issue/Bug]: Editor Presence causes Godot to force close on project startup #77
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened?
When I first installed the Discord RPC plugin by VaporVee and enabled the editor presence feature, it worked fine. but when I tried to do it the next day Godot would crash and force close as soon as I opened the project.
To resolve this issue, I investigated the plugin's code and found that the error seemed to be caused by the plugin trying to add a child node to the scene tree before the editor was fully ready.
As a workaround, I edited the plugin's code to introduce a 30-second delay before adding the child node to the scene tree. This delay allowed the editor to fully initialize, and it resolved the crashing issue for me.
However, I then noticed that the plugin's script was not correctly removing the "DiscordRPC/EditorPresence/enabled" setting when the project was closed or the scene tree was in the process of exiting. This meant that I had to manually toggle the setting off and on again to get the plugin working properly.
I'm not sure why the setting is not being removed as expected, even though the plugin appears to have the necessary code to handle this. This is an additional issue I'm facing with the plugin that I hope can be resolved.
Version
1.3.1
Godot Version
4.2.2.stable
Exact steps to reproduce this error
GDScript
Godot output
Additional information
No response
Checks
yeah thats the issue its not really possible to know when the editor is fully ready. do you think to add a timeout is a good idea in main? I don't know if people care for the delay because on some machines Godot loads fast enough and then the addon can enable that early without any problems. I need to investigate if there is a way to get a better signal for the editor beeing fully ready.
if there is no way to know when the editor is fully ready then it's the best way to fix it. But it could be a problem for someone with a bigger project and his editor takes more time than the delay. If only Godot can do error handling with add_child it could be way easier. You just need to try to add the child for every x second until it doesn't come back as an error but you can't do that in Godot. Maybe adding a delay for now and fixing it later when it's possible to do with more reliable way is the best you can do.
If there is no good signal for that i might need to do a Godot pr
I think that'll do it
i dont know if this helps, but i found the same bug and it only happens when you save the project and restart godot
also i guess it depends on the project but i tried your work around @Faeest and put only a second and the plugin now works great so thanks!