-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
error dialog is deltachat-rpc-server is not found #4479
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { ChildProcessWithoutNullStreams, spawn } from 'child_process' | |
import { app, dialog } from 'electron/main' | ||
import { BuildInfo } from '../get-build-info' | ||
import { arch, platform } from 'os' | ||
import { getLogsPath } from '../application-constants' | ||
|
||
const log = getLogger('DC-RPC') | ||
|
||
|
@@ -16,14 +17,50 @@ export class StdioServer { | |
this.serverProcess = null | ||
} | ||
|
||
async start() { | ||
start() { | ||
this.serverProcess = spawn(this.cmd_path, { | ||
env: { | ||
DC_ACCOUNTS_PATH: this.accounts_path, | ||
RUST_LOG: process.env.RUST_LOG, | ||
}, | ||
}) | ||
|
||
this.serverProcess.on('error', err => { | ||
// The 'error' event is emitted whenever: | ||
// - The process could not be spawned. | ||
// - The process could not be killed. | ||
// - Sending a message to the child process failed. | ||
// - The child process was aborted via the signal option. | ||
// ~ https://nodejs.org/api/child_process.html#event-error | ||
|
||
if (err.message.endsWith('ENOENT')) { | ||
dialog.showErrorBox( | ||
'Fatal Error: Core Library Missing', | ||
`The DeltaChat Module is missing! This could be due to your antivirus program. Please check the quarantine to restore it and notify the developers about this issue. | ||
You can reach us on [email protected] or on github.com/deltachat/deltachat-desktop/issues. | ||
|
||
The missing module should be located at "${this.cmd_path}". | ||
|
||
The Log file is located in this folder: ${getLogsPath()} | ||
-------------------- | ||
Error: ${err.message} | ||
` | ||
) | ||
} else { | ||
dialog.showErrorBox( | ||
'Fatal Error', | ||
`Error with core has been detected, please contact developers: You can reach us on [email protected] or on github.com/deltachat/deltachat-desktop/issues . | ||
|
||
${err.name}: ${err.message} | ||
|
||
The Log file is located in this folder: ${getLogsPath()}\n | ||
` | ||
) | ||
} | ||
// I think we can exit in all the cases, because all errors here are serious | ||
app.exit(1) | ||
Comment on lines
+60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where can I see the list of errors? I'm worried that there might be non-critical errors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the list is a comment at the start of the function: this.serverProcess.on('error', err => {
// The 'error' event is emitted whenever:
// - The process could not be spawned.
// - The process could not be killed.
// - Sending a message to the child process failed.
// - The child process was aborted via the signal option.
// ~ https://nodejs.org/api/child_process.html#event-error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, missed that.
I'm not sure about this. Are we unable to proceed when this happens? Have we seen this happen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better exit/crash than undefined behaviour There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's for sure. But what I'm getting at is that maybe this happens all the time right now, and Delta Chat keeps working fine, without us knowing it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will act weird if messages get lost -> like won't react to user action. Better to fail in those cases that we notice the problem and can fix it IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would leave this line out until after 1.52.0. |
||
}) | ||
|
||
let buffer = '' | ||
this.serverProcess.stdout.on('data', data => { | ||
// console.log(`stdout: ${data}`) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be rebased before merging, so that the changelog entry is not in the past/already-released version.