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
Fix #4733 - remove warning on username change #257
Conversation
If the user changes the username on My Setting -> About me view and then reverts it to the initial username, remove the warning about restart.
| self._nick_alert.hide() | ||
| else: | ||
| self._nick_alert.props.msg = self.restart_msg | ||
| self.needs_restart = True |
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 may need to restart if either the nick or the color have changed, so we can't set needs_restart to True.
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.
The else block means that the nick have changed and it's different than the original one. If we don't set self.needs.restart = True, then on saving the changes, the user doesn't get a notification about restart.
To my understanding self.needs_restart is a class property that can be set to True either on nick change or color change. In this case we want to notify that nick has changed and user needs a restart.
If I misunderstood your suggestion, I will appreciate extra explanation to fix the issue.
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.
Sorry, I was looking at the other case, when self.needs_restart = False . What if...
- user changes color -> needs_restart is set to True
- user changes nick -> needs_restart is set to True
- user changes nick back to original -> needs_restart is set to False
The dialog will not require restart, even when the color has changed.
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.
Yep, you are absolutely right.
Made the fix and committed it.
What is the workflow now? Should I cancel the current pull-request?
Is the rebase required to squash 2 commit together and push them to a new branch?
I am reading this guide - http://developer.sugarlabs.org/contributing.md.html
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.
Yep, you merge locally in another branch, name it something like "fix_namechange_try2" and push the new branch to github. I'll close this one now. Thanks!
|
Thanks for the patch, @ana-balica Here are two testcases that I think should pass. With your patch, the first one passes, but not the second. Testcase 1
The section should close without asking for a restart. This works with your patch. Testcase 2
The "warning, needs restart" still alert appears. It should not appear because the nick is the same as the original. I think testcase 1 describes the ticket #4733. So if you change the restart flag issue, I'm ok to push. If you also want to fix testcase 2, great! I think you need to remove the alert and the restart flag when the Note this has the same issue in the restart flag, so is just an example. |
|
I have reproduced testcase 2 successfully and the issue is clear to me. Thank you @manuq for such an explicit description. |
|
Great @ana-balica, I'm fine with either separate commits, or only one. Whatever works better for you. |
If the user changes the username on My Settings -> About me view and then reverts it to the initial username, remove the warning about restart.