-
-
Notifications
You must be signed in to change notification settings - Fork 455
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/Refactor] Make all logs async #3507
Conversation
{ prefix: 'Backend', skipLogToFile: true } | ||
) | ||
}) | ||
// FIXME: this test for some reason is correct in CI but `app.getPath` returning 'invalid' |
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.
Maybe run it if the ENV for CI is true.
Something like:
if (process.env.GITHUB_ACTIONS) {
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.
one thing I'm seeing now is that this is testing a case that will never happen
because from the getPath method docs, when it returns a string it's a valid path and when it's invalid it throws an error (that we are not catching), it should never return an invalid path https://www.electronjs.org/docs/latest/api/app#appgetpathname
we seem to be handling an invalid path incorrectly
I'd rather remove this test to avoid a false sense of correctness, we should actually do a try/catch in createNewLogFileAndClearOldOnes
and return if the path is invalid
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.
I updated the function to try/catch and re-implemented the test to reflect the Error thrown.
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.
LGTM
This PR is a continuation of #3384.
In that PR I moved the
lastPlay
logs to be async, and this PR moves the rest of the logs to behave the same.This has 2 main benefits:
I included one fix: there was an error in the logs when stopping a sideloaded app
Use the following Checklist if you have changed something on the Backend or Frontend: