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

[HOLD for payment 2023-12-15] [$500] IOS - A spinner appears in the chat when a message is posted #30729

Closed
1 of 6 tasks
kbecciv opened this issue Nov 1, 2023 · 44 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Nov 1, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.3.94.1
Reproducible in staging?: YES
Reproducible in production?: NO
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
Expensify/Expensify Issue URL:
Issue reported by: @mountiny
Slack conversation:

Action Performed:

  1. Log in IOS app
  2. Send the message

Expected Result:

A spinner doesn't appear in the chat when a message is posted

Actual Result:

A spinner appears in the chat when a message is posted

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

RPReplay_Final1698857268.mov
RPReplay_Final1698860649.MP4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d9960c2187a7e349
  • Upwork Job ID: 1719847322291130368
  • Last Price Increase: 2023-11-01
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 27654812
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Nov 1, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Nov 1, 2023

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Nov 1, 2023

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@aldo-expensify
Copy link
Contributor

Can't reproduce in Web, I'm trying to setup my env to run IOS

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Nov 1, 2023

I'm not being able to reproduce this.

This is the code that renders that spinner at the bottom:

<View style={[stylesGenerator.alignItemsCenter, styles.justifyContentCenter, styles.chatBottomLoader]}>
<ActivityIndicator
color={themeColors.spinner}
size="small"
/>
</View>
(thanks @Beamanator)

This can only happen when type is HEADER, so the only usage of the ListBoundaryLoader we should look at is this one:

https://github.com/Expensify/App/blob/30da921305c0b70cef887ce0321b3da820afbfd8/src/pages/home/report/ReportActionsList.js#L401C1-L404

@aldo-expensify
Copy link
Contributor

Asking for help reproducing here: https://expensify.slack.com/archives/C01GTK53T8Q/p1698867709638349

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Nov 1, 2023

I was able to reproduce more consistently with @s-alves10 's help. I'll try to reproduce in production to see if this is a real deploy blocker or not

@s-alves10
Copy link
Contributor

I think this would be reproducible in production as well

@aldo-expensify aldo-expensify added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Nov 1, 2023
@aldo-expensify
Copy link
Contributor

aldo-expensify commented Nov 1, 2023

I think this would be reproducible in production as well

I had the same feeling, and I just confirmed it.

Removing deploy blocker, reproduced in production:

Screen.Recording.2023-11-01.at.1.48.23.PM.mov

My guess is that this may have been caused by this PR: #26166 that introduced the bidirectional pagination for comments

@aldo-expensify aldo-expensify added the Bug Something is broken. Auto assigns a BugZero manager. label Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Nov 1, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@aldo-expensify aldo-expensify added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 1, 2023
@s-alves10
Copy link
Contributor

s-alves10 commented Nov 1, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

A spinner appears in the chat when pressing enter after send a message

What is the root cause of that problem?

Please check the code

maintainVisibleContentPosition={{
minIndexForVisible: 0,
autoscrollToTopThreshold: variables.listItemHeightNormal,
}}

minIndexForVisible makes the flatlist change its scroll position to maintain the position of the last message when sending a new message(Please refer https://reactnative.dev/docs/scrollview#maintainvisiblecontentposition). This causes onStartReached call.

This is the root cause

What changes do you think we should make in order to solve the problem?

I think we can safely remove the minIndexForVisible setting.

autoscrollToTopThreshold was added to fix #30395 and #30423 but these issues doesn't happen without minIndexForVisible setting. So we can remove the maintainVisibleContentPosition props

Remove the code below

maintainVisibleContentPosition={{
minIndexForVisible: 0,
autoscrollToTopThreshold: variables.listItemHeightNormal,
}}

This works fine as expected

Result
30729.mp4

What alternative solutions did you explore? (Optional)

@aldo-expensify aldo-expensify added the External Added to denote the issue can be worked on by a contributor label Nov 1, 2023
@melvin-bot melvin-bot bot changed the title IOS - A spinner appears in the chat when a message is posted [$500] IOS - A spinner appears in the chat when a message is posted Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01d9960c2187a7e349

Copy link

melvin-bot bot commented Nov 1, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

@tienifr
Copy link
Contributor

tienifr commented Nov 2, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

IOS - A spinner appears in the chat when a message is posted

What is the root cause of that problem?

We're using onStartReached to support Bidirectional pagination, but when the new message comes in, onStartReached is trigger

Additionally, we don't have the logic to stop loading newer message like what we did with older message (oldestReportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED)

-> API GetNewerActions is called and the spinner is shown

What changes do you think we should make in order to solve the problem?

We should add the stop condition in loadNewerChats if we already loaded all messages.

  1. get the length of reportActions (include the deleted message)
  2. compare this length with report.maxSequenceNumber, if props.reportActionsLength >= props.report.maxSequenceNumber we can early return

Optional: We can increase maxSequenceNumber optimistically when we add the new message

Result

Screen.Recording.2023-11-02.at.10.24.19.mov

@roryabraham
Copy link
Contributor

cc @quinthar as you reported a similar bug in slack

Copy link

melvin-bot bot commented Nov 27, 2023

@conorpendergrast, @abdulrahuman5196, @roryabraham, @perunt Whoops! This issue is 2 days overdue. Let's get this updated quick!

@perunt perunt mentioned this issue Nov 28, 2023
47 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 Weekly KSv2 labels Nov 28, 2023
@conorpendergrast
Copy link
Contributor

@roryabraham could you give a perspective on this, please?

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 8, 2023
@melvin-bot melvin-bot bot changed the title [$500] IOS - A spinner appears in the chat when a message is posted [HOLD for payment 2023-12-15] [$500] IOS - A spinner appears in the chat when a message is posted Dec 8, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Dec 8, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.9-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-12-15. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Dec 8, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@abdulrahuman5196] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@conorpendergrast] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 14, 2023
Copy link

melvin-bot bot commented Dec 18, 2023

@conorpendergrast, @abdulrahuman5196, @roryabraham, @perunt Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@conorpendergrast
Copy link
Contributor

Payouts due:

Issue Reporter: N/A - @mountiny
Contributor: N/A (contractor) @perunt

Upwork job is here.

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
@conorpendergrast
Copy link
Contributor

@abdulrahuman5196 just the C+ checklist to do now, thanks!

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

Seems to related to code changes introduced as part of comment linking.

Determine if we should create a regression test for this bug.

Yes. If not already present.

If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

  1. Open a chat and check the bottom loader, you shouldn't see it.
  2. Scroll to the top and bottom to check if it appears.
  3. Send messages.
  4. No bottom loader should appear as you send messages

Thank you for processing. @conorpendergrast I have also added the checklist.

@melvin-bot melvin-bot bot added the Overdue label Dec 21, 2023
Copy link

melvin-bot bot commented Dec 22, 2023

@conorpendergrast, @abdulrahuman5196, @roryabraham, @perunt Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@conorpendergrast
Copy link
Contributor

Regression test created: https://github.com/Expensify/Expensify/issues/353947

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants