You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
Changing the .surfbird file in different ways causes the app to throw different errors. We have to differentiate between two problems regarding this issue:
The content of the .surfbird file is not valid JSON.
The service object has missing/wrong data
Additional Information
Fixing the first point of the issue should be quite easy. If we take a look at the load()-method in the src/main/authentication/index.js file, we can see that the only safety check is if the file exists before parsing it to JSON. Maybe the the return of the JSON.parse function should be wrapped in a try-catch statement?
static load () {
let file = path.join(Authentication.homePath(), '.surfbird')
if (!fs.existsSync(file)) {
return null
}
return JSON.parse(fs.readFileSync(file, 'utf-8'))
}
For the second point we should maybe implement a check if the provided credentials are working and if not, ask the user to log in again to fix the file.
The text was updated successfully, but these errors were encountered:
I guess we can implement multiple checks here. The one you noted, catching errors on load, and maybe another one for each client (checking if the object/keys are added properly, otherwise failing)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Changing the .surfbird file in different ways causes the app to throw different errors. We have to differentiate between two problems regarding this issue:
Additional Information
Fixing the first point of the issue should be quite easy. If we take a look at the load()-method in the
src/main/authentication/index.js
file, we can see that the only safety check is if the file exists before parsing it to JSON. Maybe the the return of the JSON.parse function should be wrapped in a try-catch statement?For the second point we should maybe implement a check if the provided credentials are working and if not, ask the user to log in again to fix the file.
The text was updated successfully, but these errors were encountered: