-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
If a user has some non-default tab selected and wipes their database, Mist would try (and fail) to select that tab, resulting in a blank screen as well. This PR also fixes this bug (see appStart.js). |
|
||
fs.accessSync(filePath, fs.R_OK); | ||
|
||
fs.accessSync(filePath, fs.W_OK); |
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.
@hiddentao here i've changed to check if the file is writeable. we could circumvent permission errors more easily.
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.
Yeah, saw that. That looks fine to me. We could do fs.R_OK | fs.W_OK
I suppose.
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.
good idea. added to pr.
}); | ||
}) | ||
.then(function() { | ||
window.trigger('mist-ready'); |
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.
Yes, this was also bugging me and giving an error. @hiddentao do you remember what it was for?
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.
It was for future usage. A dapp would be able to listen to the mist-ready
event to know when all data was loaded and ready. I'd prefer if this was re-instated.
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.
but trigger isn't even a valid function. Did you meant $(window).trigger
?
I'll perform both fixes |
It saves the collections correctly, but I never had the original problem |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Fixes the race condition at startup, where the
mistInit()
was expected to have the DB synced before insert the Tabs from the database.It ensures
syncMinimongo.frontendSync
resolves a promise when the collections are empty.