software-mansion / react-native-ide

https://ide.swmansion.com
Other
705 stars 21 forks source link

Add failsafe mechanism for cloning sim-server binary #368

Closed kmagiera closed 2 weeks ago

kmagiera commented 2 weeks ago

When debugging IDE with some users I noticed a strange setup in which the IDE ended up in a state with no sim-server binary. We couldn't get to the bottom of this issue, as subsequent installation went through, but decided to add a more failsafe mechanism for this procedure to prevent similar issue in the future or at least to let us investigate it better.

The problem: Before we'd "fix" sim-server binary by copying it first to temp location and then using dd moving it back to original path. When some of the commands would fail, we could end up with the sim-server binary completely deleted and subsequent runs wouldn't allow for recovery as there was no way to retry it once it's deleted. Furthermore, reinstalling the extension didn't help in those scenarios as it doesn't delete installation dir and so long the version doesn't change, vscode won't download/unpack the new package.

The solution: 1) we now allow activation to continue despite error in binary fixing step. This way people will at least be able to access diagnostics and will get more meaningful errors once they attempt to spawn a simulator. 2) we also use an alternative path for executable binary. Such that instead of deleting sim-server and then copying it back from temp location, we only perform one copy to a new location. This way if the copy fails, we can safly retry it next time the extension is run.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 8:22pm