Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Fixes blank screen at startup #1110

Merged
merged 7 commits into from
Aug 24, 2016
Merged

Conversation

evertonfraga
Copy link
Member

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.

@evertonfraga evertonfraga added this to the 0.8.2 milestone Aug 24, 2016
@evertonfraga evertonfraga self-assigned this Aug 24, 2016
@evertonfraga
Copy link
Member Author

evertonfraga commented Aug 24, 2016

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);
Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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');

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?

Copy link
Contributor

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.

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 ?

@evertonfraga
Copy link
Member Author

I'll perform both fixes

@alexvandesande
Copy link

It saves the collections correctly, but I never had the original problem

@alexvandesande alexvandesande merged commit 9e6dcbd into ethereum:develop Aug 24, 2016
@evertonfraga evertonfraga deleted the fix-lokidb branch October 5, 2016 20:58
@lock
Copy link

lock bot commented Mar 31, 2018

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.

@lock lock bot locked and limited conversation to collaborators Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants