Skip to content
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

feat(desktop): add database reset page to fix blank screen from corrupted file #1627

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

DM1-1
Copy link
Contributor

@DM1-1 DM1-1 commented Apr 11, 2024

PR Checklist

If you have any questions, you can refer to the Contributing Guide

What is the current behavior?

The current behavior is that the application displays a blank screen when the database file is corrupted, preventing users from interacting with the application.

Issue Number

#1370

What is the new behavior?

The new behavior is that upon detecting a database corruption, the application will redirect the user to an error page where they can initiate a database reset. This resolves the white screen issue and allows the user to restore the application to a working state.

Does this PR introduce a breaking change?

  • Yes
  • No

Specific Instructions

If you wish to conduct testing, you can do so by altering the fields within the MQTTX.db file in the application data to make them non-conforming to the schema.

Other information

The UI and UX for the error page and database reset feature are still a work in progress and will be refined in future updates.
This change has been tested on macOS and Windows platforms to confirm that it resolves the white screen issue caused by database corruption.

@DM1-1
Copy link
Contributor Author

DM1-1 commented Apr 11, 2024

image

After reset database

image

@ysfscream ysfscream added enhancement New feature or request fix Fix bug or issues performance Improve some performance desktop MQTTX Desktop labels Apr 12, 2024
@ysfscream ysfscream added this to the v1.10.0 milestone Apr 12, 2024
src/store/getter.ts Outdated Show resolved Hide resolved
src/components/DatabaseError.vue Outdated Show resolved Hide resolved
src/components/DatabaseError.vue Outdated Show resolved Hide resolved
@Red-Asuka
Copy link
Member

@ysfscream Do you think it is necessary to add a second confirmation popup and button loading?

@ysfscream
Copy link
Member

ysfscream commented Apr 12, 2024

@ysfscream Do you think it is necessary to add a second confirmation popup and button loading?

@Red-Asuka Of course, this is an operation that requires user consent and a secondary confirmation. it's a good suggesion.

However, I'm suddenly wondering if it's possible to recover some data from the damaged database before rebuilding the database file? @DM1-1

@DM1-1
Copy link
Contributor Author

DM1-1 commented Apr 12, 2024

@ysfscream Do you think it is necessary to add a second confirmation popup and button loading?

@Red-Asuka Of course, this is an operation that requires user consent and a secondary confirmation. it's a good suggesion.

However, I'm suddenly wondering if it's possible to recover some data from the damaged database before rebuilding the database file? @DM1-1

When displaying this page, the database has been unable to connect successfully. I am uncertain whether it is possible to retrieve information from the database and filter out the data that caused the connection failure.

@ysfscream
Copy link
Member

@DM1-1 YES, i think so. I mean, we can minimize the loss of user data as much as possible. So, maybe we can do some more technical research? What do you think? Even if we can't recover all the data, we could discard the messages but keep some simple information that can be appropriately located, including connection details.

For example, we could directly read the database file, or look online for other methods. If it's completely damaged and unreadable, this method won't work, and we can display this page as is.

@DM1-1
Copy link
Contributor Author

DM1-1 commented Apr 15, 2024

Kapture 2024-04-15 at 17 03 28

@DM1-1 DM1-1 marked this pull request as ready for review April 18, 2024 01:06
@DM1-1 DM1-1 requested review from ysfscream and Red-Asuka April 18, 2024 01:06
src/background.ts Outdated Show resolved Hide resolved
src/background.ts Outdated Show resolved Hide resolved
@DM1-1 DM1-1 reopened this Apr 18, 2024
@DM1-1
Copy link
Contributor Author

DM1-1 commented Apr 18, 2024

image

@ysfscream ysfscream merged commit e552ddd into emqx:main Apr 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop enhancement New feature or request fix Fix bug or issues performance Improve some performance
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants