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

Fix for error message when reloading iOS application during build #25

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/vscode-extension/src/project/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,12 @@ export class Project implements Disposable, MetroDelegate, ProjectInterface {
status: "running",
previewURL,
});
} catch (e) {
} catch (e: any) {
//TODO: find where can we catch this error to prevent it from leaking here (if statment below is a hotfix of issue #8)
if (/Command was killed with SIGKILL \(Forced termination\): xcodebuild/.exec(e.message)) {
Logger.debug(e);
return;
}
Copy link
Member

@kmagiera kmagiera Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this add extra check to the if block below to verify if this.deviceSession === newDeviceSession

also in line 324 do:

const prevSession = this.deviceSession;
this.deviceSession= undefined;
prevSession?.dispose();

Logger.error("Couldn't start device session", e);
if (this.projectState.selectedDevice === deviceInfo) {
this.updateProjectState({
Expand Down
Loading