-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
Upload UX Improvements #1042
Upload UX Improvements #1042
Conversation
When are you expecting to complete this PR. |
I think I am finished. It would be good to get a few people to test. |
Without this fix, the distObject that is prepared for the PATCH command sent to GitHub can contain malformed objects resulting in a HTTP 422 error. For example, if you have a c.json snippet, the distObject will contain a "snippets/c.json" file with valid contents and also a "snippets|c.json" file with null content.
Add a status bar message for the case when the local files already match those in the gist when the user requests an upload. This is a message that is symmetrical to the message shown when a user tries to download and already has the latest.
cmd.updateSettings.info.gotLatestVersion in package.nls.zh-tw.json is simplified chinese. It should be added in package.nls.zh-cn.json |
Sorry, but it looks like Google Translate gave me the same translation for simplified and traditional. Could you please supply the correct strings for both of these? |
@karl-lunarg I have pulled PR, run the following scenario:
Upload isnt working, instead its showing the dialog "Sync: The settings in the gist have changed since ..." |
This was a bug in the call to the After a reset, This caused the upload code to think that the gist is newer and so it showed the dialog.
Fix is to not do the conversion. I'll push a fix for this. |
Exactly! Thank you for a detailed explanation. Fantastic Work
I hope you have tested all the possible scenarios you have mentioned. (Ref : #1035 (comment) , #1035 (comment) and above scenarios) I have tested it and it looks fine but as Settings Sync dont have proper test cases defined since start and i always miss that. I just want to know are you available to fix if somethings comes up after release regarding this feature ? So i can release hitfix for it if somethings happens. |
In these recent commits, I refactored the two commits that contained the related changes for moving the download date conversion to inside of I also added a commit to remove trailing whitespace so that |
I did pretty thorough testing after the main changes, but I want to do them all again and more after these more recent minor changes. I'll do that in the next day or so. This project is difficult to test because of all the possible cases and the difficulty in setting up some of them.
I use vscode and this extension a lot (thanks for it, btw), so I have some interest in keeping it in good shape, so I'll try to pay attention to the repo. I have improved the code a bit by making it simpler, fixing a few bugs, and adding some comments to help make the logic clearer. So I'm hoping that you and/or the other contributors to this project who know a lot more than me about all this can take the first crack at any problems. I'll help out as needed. I use vscode and this extension on several dev machines. On one of them, I can't seem to test the extension using the Extension Development Host, the second instance of vscode that pops up when you debug the extension from the primary instance. The extension under test fails to load in the EDH and I get messages in the Debug Console saying Any ideas? |
Perfect. Just let me know once your testing is completed and yes testing this extension is hard specially when you are already have dev. env. and using this extension for your env. for this i would suggest you to use vscode portable and setup that code for this extension only so you dont have to switch to extension debugging env. and your personal env. for work.
Have you tried running vscode in Admin Mode, just make sure you are installing the
If still you can't test on other computers, you can create a package using |
- Remove "Don't show this again" logic and setting from the "Gist is newer than what you downloaded dialog". This is not needed after the following change. - Change the "Don't show this again" dialog to ask if the user wants to do a one-time force upload if the gist last upload time is prior to the local last download time. - Fix bug where the user had to resort to a force upload when trying to upload settings changes. - NLS for new messages and dialogs. - README.md addition to explain how upload conflicts are handled.
Fix Chinese nls packages Co-Authored-By: YunChaoTsai <yunchao2081@gmail.com>
Move the conversion of customSettings.lastDownload to a Date to inside of IsGistNewer(). This allows the function to check for a null value for customSettings.lastDownload before converting. Converting a null results in a valid Date of Jan 1, 1970 which resulted in always comparing against this old date.
When forceUpload is true, we should skip the dialog warning user that the gist is newer than the last download.
I got my eyeballs on the two machines at the same time and found that I had just installed npm/nodejs differently and incorrectly on one of them. I've reinstalled and I think I have it sorted. I should have mentioned that this was on Linux. I found this guide helpful. |
Testing: I've finished testing and updated the test plan I used up in the top comment. Things look pretty good. But there is one corner-case problem:
The settings will upload to the gist, overwriting the change made by the other machine, without prompting. This is caused by the lack of a localLastDownload date after the reset. Without this, I can't tell if the gist has changed since the last download. One way out of this is to throw a new dialog message if the files are different and there is no localLastDownload date. Something like "Settings Sync is unable to reconcile the differences between your local settings and your gist. Consider downloading the settings or doing a forced upload now. Do you want to upload your current local settings to the gist now?" And there would be the same Yes/No buttons as the other dialog. Another option would be to try to merge the above idea in the existing dialog, saying something like "The settings in the Gist have changed since you last downloaded them or you have reset your Sync Settings. Do you want to upload your current local settings to the gist now?". I sort of prefer the new dialog, since giving the user two reasons for the popup error is not very useful. @shanalikhan Should we fix this for this release? The exposure to these conditions might be pretty small, but there is unannounced data loss. (Although, it can be recovered from the git gist). |
Yes you are right, @karl-lunarg Settings Sync doesnt check for that case. Thank you for the detailed testing of each scenario.
If you can fix that dialog, i would recommend to add that new dialog too in this PR so UX will be perfect handling all of the situations. Instead of "Settings Sync is unable to reconcile the differences between your local settings and your gist. Consider downloading the settings or doing a forced upload now. Do you want to upload your current local settings to the gist now?" I would suggest: "Upload will replace the older version of Settings in GitHub Gist. Consider downloading the settings or doing a force upload. Do you still want to upload forcefully ?" Phrase can be improve furthermore. |
After resetting the settings, there is no lastDownload date stored locally, so we can't tell how the gist settings relate to the local settings. So, present the user with a general "Do you want to force upload?" dialog. This new dialog differs from the "gistNewer" dialog because we can definately say that the gist settings changed since the last download in the "gistNewer" case, which is useful to the user.
@shanalikhan : I agree that it is good to fix this now. I wasn't completely sure if you wanted the new dialog or not. We have a lot more information when there is a valid last download date, so I felt a new dialog was better since the existing This adds more NLS entries. @YunChaoTsai, I likely got the Chinese translations wrong again, so if you could please look at those in the last commit and use the GitHub suggestion mechanism to fix them, that would be great, just like you did last time. I did the testing for this latest change and things look good. I think I am done. This seems to be a reasonable improvement over the current version. |
Thanks @karl-lunarg for all the effort you put into this. Really appreciated! |
Thank you for you detailed effort and testing all of the possible scenarios. I will release the next version in few days. |
Task checklist (roughly):
Update README doc(reverted to original)Short description of what this resolves:
Changes proposed in this pull request:
Fixes: #1035
How Has This Been Tested?
Since only the Upload logic was changed, it was necessary to test only upload features
Screenshots (if appropriate):
n/a
Checklist: