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

#24908: Validate saved files and alert user #24911

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

krasko78
Copy link
Contributor

@krasko78 krasko78 commented Sep 24, 2024

Resolves: #24908

Initial commit to demonstrate the idea and start refining it.

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@krasko78 krasko78 marked this pull request as draft September 24, 2024 23:20
@krasko78 krasko78 force-pushed the 24908-PreventCorruptedFilesOnSave branch from 9648983 to 13f2353 Compare September 24, 2024 23:38
@krasko78
Copy link
Contributor Author

Do we want to limit this to Windows users only?

@RomanPudashkin
Copy link
Contributor

Do we want to limit this to Windows users only?

I'd rather keep it for all OS

@DmitryArefiev
Copy link
Contributor

@krasko78 Can you restart builds please? Linux build is missing

@Jojo-Schmitz
Copy link
Contributor

Non-staff-members can't do that

@Jojo-Schmitz
Copy link
Contributor

But there is an issue with the translatable strings, like subsequent trailing whitespace, which the Linux build stumbles accross

Also a code style issue

@krasko78
Copy link
Contributor Author

@Jojo-Schmitz How can I do the code style validation from inside Qt Creator or before I commit?

@Jojo-Schmitz
Copy link
Contributor

The latter, running uncrustify locally, but I rather let GitHub CI let it do for me 😉

@krasko78
Copy link
Contributor Author

@bkunda @RomanPudashkin @cbjeukendrup @Jojo-Schmitz @wizofaus
Here is the warning dialog for review:
image

@krasko78
Copy link
Contributor Author

krasko78 commented Sep 27, 2024

Gah, no, I still don't like it... But let hear everyone out and I'll edit it accordingly.
How about this one:
image

@krasko78 krasko78 force-pushed the 24908-PreventCorruptedFilesOnSave branch from 6a0c117 to 7ecb595 Compare September 27, 2024 22:45
…e and only if unsuccessful to not degrade save times + code review changes
@krasko78 krasko78 force-pushed the 24908-PreventCorruptedFilesOnSave branch from 7ecb595 to 6fed602 Compare September 27, 2024 22:51
@wizofaus
Copy link
Contributor

@Jojo-Schmitz How can I do the code style validation from inside Qt Creator or before I commit?

If you're on Windows I have a batch file that can both check and fix all modified files, though you need to install a specific version of uncrustify.
I hate having to wait for the github CI job to fail the PR.

@Jojo-Schmitz
Copy link
Contributor

There's not much to wait, it fails quite fast

@krasko78
Copy link
Contributor Author

It is building fine now and I am publishing the PR. Please make sure you've looked at the latest changes. Thanks.

@krasko78 krasko78 marked this pull request as ready for review September 28, 2024 10:21
@bkunda
Copy link

bkunda commented Sep 30, 2024

Thanks for tackling this problem @krasko78! Great to have a solution that will prevent this kind of file corruption.

My only comment has to do with the UI copy and dialog design. To better align it with our existing corruption dialogs, and to simplify the messaging, I'd prefer to see the following:

Group 1

Then when "Show details" is clicked, the error message appears below (and the dialog expands accordingly):

Group 2

As I understand it, when a score file gets filled with 0s, it's no longer usable and in all cases needs to be re-saved. In this case, the messaging should be much simpler, and we should just give the user a button that triggers the OS save dialog ("Save a copy").

For bonus points, the "musescore.org" hyperlinked text should point directly to the relevant forum: https://musescore.org/en/forum/6

Let me know if this makes sense!

@cbjeukendrup
Copy link
Contributor

@bkunda That is not 100% accurate. I will explain the problem in more detail later today (right now omw to an exam 🙂)

@krasko78
Copy link
Contributor Author

Btw, should we say "corrupted" or "corrupt"? I believe we should use "corrupt" when we want the adjective. Native English speakers please advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mitigate corruption of scores on save
7 participants