-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Web - Error doesn't disappear for a while after deleting entire max exceed message. #27698
Comments
Triggered auto assignment to @jliexpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~01b8cf25e3b2eb870f |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @sonialiap ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
ResultScreencast.from.19-09-2023.00.20.01.webm |
Please re-state the problem that we are trying to solve in this issue. Error doesn't disappear for a while after deleting entire comment when it has exceeded the maximum message What is the root cause of that problem? The debouncer applies the delay when the comment length is being changed. When it goes to a length of 0, it is still waiting COMMENT_LENGTH_DEBOUNCE_TIME to show that. What changes do you think we should make in order to solve the problem? Conditionally apply the debouncer if comment value is not null. It still keeps existing functionality debouncer intact when the user is typing but it will allow on a sudden delete of everything to not apply it. const updateCommentLength = useMemo(() => {
}, [comment, onExceededMaxCommentLength]); What alternative solutions did you explore? (Optional)
const updateCommentLength = useCallback((comment, onExceededMaxCommentLength) => {
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Proposal Please re-state the problem that we are trying to solve in this issue. Error doesn't disappear for a while after deleting entire comment when it has exceeded the maximum message What is the root cause of that problem? Two problems add up to a 1.5 sec delay:
What changes do you think we should make in order to solve the problem? Three changes:
and then in the updateComment function, add a call to the onChangeText prop (if passed). Also add onChangeText to prop types and document.
Then change the comment param to just reference the comment variable above.
And to ComposerWithSuggestions add the property
This code is currently working in my local repo and the red border and line count exceeded message are removed immediately. It also works when editing a comment, not just composing a new one. |
Bumping @sobitneupane for reviews! |
Thanks for your proposal @DylanDylann
Where are you suggesting to make the change? Will it affect if we have existing draft comment?
I don't think we can do that. This change was made to improve performance and was intended. |
If we fail to identify a straightforward and direct solution, I believe it may be appropriate to consider closing the issue |
|
|
My solution does not change any of the delays on saving the report in onyx or in setting the error, but it does remove the error immediately by short circuiting the debounce check and directly checking the changed form value rather than the debounced saved report value. |
Bump @sobitneupane to address comments |
Bumping @Ollyws ! |
Still considering this one... |
From what I can see it doesn't seem like there is any easy way we can remove the debounce. |
@Ollyws my proposal has two options to remove the debounce: One option can reduce 1000ms and another is 500ms. Combining both can reduce all the debounce. I am very confident that we can go with the 1st option, and just need to consider whether we use 2nd option as well |
@Ollyws you can take a look at my proposal and feel free to ask more question about it. Thanks |
As far as I can see the only part of your proposal that could be implemented would be method 1, but there were these unresolved comments about that:
I agree with
The debounce was added in #15501 for performance reasons and I don't think it's worth decreasing the performance of the composer, the most used component in the app in order to increase the speed of this very edge case scenario. |
I just checked the current edit message`s logic, the behavior is slightly different from the message composer logic: The message composer error is updated with ~1500 ms delay, but the message edit is only ~ 500 ms. As the RCA mentioned in my proposal, there are two factors led to the delay (with the message composer): And the message edit only encounter the case hasExceededMaxCommentLength is set by debounce function updateCommentLength(comment,onExceededMaxCommentLength) - delay 500ms |
Ah sorry I missed that response. |
@Ollyws yeah. You are correct. So in suggestion is:
RCA:
Solution:
|
@DylanDylann How do you plan to get the |
@Ollyws yeah, it is my plan |
But how exactly? |
Yeah. I still go with this solution because it is very straightforward |
@DylanDylann I'm asking how will you get the |
@Ollyws Sorry for misunderstood your question
|
@Ollyws Please help review my solution here when you have a chance #27698 (comment) |
I think given that there is another issue #30921 open for the edit message character limit not working, and that while some proposals can mitigate this slightly it's essentially impossible to fix completely without removing the debounce, so along with my previous reasoning I vote to close this. |
@jliexpensify What do you think about this one #27698 (comment)?
|
@DylanDylann in all honesty, I'm going to defer to @Ollyws here - my main role is to help troubleshoot and manage the issue, and as the C+, Olly should be finding suitable proposals. Given that he's already mentioned that it's an edge case and this issue should be closed a few times already, I'm inclined to lean towards this as well - also this statement indicates we won't really be solving the issue?
If Olly did think it was an actual issue, my understanding is that he would have chosen a proposal and asked for an internal engineering review. Going to close this one out! |
Many thanks @jliexpensify and @Ollyws |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Error should disappear right after user deleted the message.
Actual Result:
Composer still has error for a while after deleting message.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.71.4
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-09-17.at.14.50.21.mov
Recording.4576.mp4
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694937014673629
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: