-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Footer gets updated as many times as the edit key is pressed on any uneditable message #647
Comments
To clarify, for me it updates the footer multiple times with different help hints, after the error message stops being displayed. |
Also, this doesn't require the last key for me - just wait, and it will update the bottom bar rapidly after the timeout. |
@neiljp @preetmishra What is the expected behaviour here? |
@kaustubh-nair The footer text should only get updated once after the timeout. |
Agreed, this seems fairly obvious from manual testing. |
Currently, if multiple calls are made to set the footer along with a duration to reset it (for example, when tries to edit an uneditable message too often by pressing the key too many times) then it leads to repeated footer updates because all those calls lead to resetting the footer. The goal of this commit is to change that, and reset the footer only once, by ignoring other updates. A queue is maintained containing number of sleep threads currently active, and if there are none left then the footer is reset. This ensures that only the last call to set_footer_text() resets the footer, thus avoiding multiple resets. Also, note that it is not strictly necessary to store the duration in the queue, we could any number we like. However it is kept this way in case we would like to do more with this in the future, say, spacing out tight reset calls with only a small duration between them. Test added. Fixes zulip#647.
Currently, if multiple calls are made to set the footer along with a duration to reset it (for example, when tries to edit an uneditable message too often by pressing the key too many times) then it leads to repeated footer updates because all those calls lead to resetting the footer. The goal of this commit is to change that, and reset the footer only once, by ignoring other updates. A queue is maintained containing number of sleep threads currently active, and if there are none left then the footer is reset. This ensures that only the last call to set_footer_text() resets the footer, thus avoiding multiple resets. Also, note that it is not strictly necessary to store the duration in the queue, we could any number we like. However it is kept this way in case we would like to do more with this in the future, say, spacing out tight reset calls with only a small duration between them. Test added. Fixes zulip#647.
Currently, if multiple calls are made to set the footer along with a duration to reset it (for example, when tries to edit an uneditable message too often by pressing the key too many times) then it leads to repeated footer updates because all those calls lead to resetting the footer. The goal of this commit is to change that, and reset the footer only once, by ignoring other updates. A queue is maintained containing number of sleep threads currently active, and if there are none left then the footer is reset. This ensures that only the last call to set_footer_text() resets the footer, thus avoiding multiple resets. Also, note that it is not strictly necessary to store the duration in the queue, we could any number we like. However it is kept this way in case we would like to do more with this in the future, say, spacing out tight reset calls with only a small duration between them. Test added. Fixes zulip#647.
Currently, if multiple calls are made to set the footer along with a duration to reset it (for example, when tries to edit an uneditable message too often by pressing the key too many times) then it leads to repeated footer updates because all those calls lead to resetting the footer. The goal of this commit is to change that, and reset the footer only once, by ignoring other updates. A queue is maintained containing number of sleep threads currently active, and if there are none left then the footer is reset. This ensures that only the last call to set_footer_text() resets the footer, thus avoiding multiple resets. Also, note that it is not strictly necessary to store the duration in the queue, we could any number we like. However it is kept this way in case we would like to do more with this in the future, say, spacing out tight reset calls with only a small duration between them. Test added. Fixes zulip#647.
Currently, if multiple calls are made to set the footer along with a duration to reset it (for example, when tries to edit an uneditable message too often by pressing the key too many times) then it leads to repeated footer updates because all those calls lead to resetting the footer. The goal of this commit is to change that, and reset the footer only once, by ignoring other updates. A queue is maintained containing number of sleep threads currently active, and if there are none left then the footer is reset. This ensures that only the last call to set_footer_text() resets the footer, thus avoiding multiple resets. Also, note that it is not strictly necessary to store the duration in the queue, we could any number we like. However it is kept this way in case we would like to do more with this in the future, say, spacing out tight reset calls with only a small duration between them. Test added. Fixes zulip#647.
Currently, if multiple calls are made to set the footer along with a duration to reset it (for example, when tries to edit an uneditable message too often by pressing the key too many times) then it leads to repeated footer updates because all those calls lead to resetting the footer. The goal of this commit is to change that, and reset the footer only once, by ignoring other updates. A queue is maintained containing number of sleep threads currently active, and if there are none left then the footer is reset. This ensures that only the last call to set_footer_text() resets the footer, thus avoiding multiple resets. Also, note that it is not strictly necessary to store the duration in the queue, we could any number we like. However it is kept this way in case we would like to do more with this in the future, say, spacing out tight reset calls with only a small duration between them. Test added. Fixes zulip#647.
This prevents rapid footer updates if an error message is triggered multiple times. An example of this would be a user holding-down/pressing too often the edit message key on a message that cannot be edited. This fix does not account for updates that might happen for different messages, but we can safely assume that the time difference between such messages would not be too small and such a bug would most likely not occur. Test added. Fixes zulip#647.
This prevents rapid footer updates if an error message is triggered multiple times. An example of this would be a user holding-down/pressing too often the edit message key on a message that cannot be edited. This fix does not account for updates that might happen for different messages, but we can safely assume that the time difference between such messages would not be too small and such a bug would most likely not occur. Test added. Fixes zulip#647. Comment & slight adjustment by neiljp.
This prevents rapid footer updates if an error message is triggered multiple times. An example of this would be a user holding-down/pressing too often the edit message key on a message that cannot be edited. This fix does not account for updates that might happen for different messages, but we can safely assume that the time difference between such messages would not be too small and such a bug would most likely not occur. Test added. Fixes #647. Comment & slight adjustment by neiljp.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: