Closed m-natarajan closed 5 months ago
@janicduplessis who commented in Slack, would love to get you involved here. I'm leaning towards maybe just having @shahinyan11 handle the RNW workaround, and then assigning you to a separate issue to handle these in RN and RNW natively - does that sound alright?
@twisterdotcom Sounds good, I can handle the RN part, I am pretty familiar with that code.
@shahinyan11 Can you please update your proposal to fix the RNW bug (should fix both extra calls on focus and on blur)
What do you think about merging something like this so when not using comment linking we just never try to fetch newer messages as there will never be any. I think this can be a good improvement to this for now until we can have a better integration with the backend as discussed here.
I also think I found a good solution to help avoid invalid calls to onStartReached in react-native so that will help for the case where we are actually using comment linking and GetNewerActions should get called, but only once.
Updated. Added solution which will fix two bugs. I think the logic of my proposed solution can be used also in native level
@s77rt can we assign @shahinyan11?
@shahinyan11 I’m pretty sure comment linking relies on the fact that onStartReached is called initially. Would you be able to test this to make sure your solution doesn’t break this?
I think it could be an ok temporary solution, but we should still implement other improvements mentioned here.
@shahinyan11 I’m pretty sure comment linking relies on the fact that onStartReached is called initially. Would you be able to test this to make sure your solution doesn’t break this?
I just added a new alternative solution. But can you explain what you mean by comment linking? . Could you describe an example ?
Updated. Added alternative solution
@shahinyan11 If you take a chat with many messages you can right click on a message in the middle and Copy Link. Then in another chat you can link to that message. This will use GetNewerActions and onStartReached to load the newer messages so we have to make sure this still works properly.
@janicduplessis Yes you are correct. My main solution will break it so I updated it to allow onStartReached
to be called one time
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@shahinyan11 On focus the callback is still executed https://snack.expo.dev/aZqOHa5m9m1AoGHGqAhoN?platform=web Also why you are adding e.distanceFromStart === 0
check?
@s77rt It is necessary that the callback be executed once during focus. See this https://github.com/Expensify/App/issues/39674#issuecomment-2079352605 .
distanceFromStart
returns the scroll distance that was scrolled before reaching the start and it always 0
on init
What's the next step and ETA on this?
I think there are a few things we can do to improve this. This issue has 2 main causes:
onStartReached
is called more than it should. Ideally this would be fixed in react-native upstream.For 1. I have a PR ready, need to be reviewed by meta engineers. We could make a patch for it to use it now.
For 2. I discussed this with @roryabraham and he will tackle this task when he can, I created this issue to track this.
In the meantime I suggest merging some of the workarounds proposed here. I think the simplest and safest option would be to just never call GetNewerActions when we are not in a comment linking report as implemented here.
@shahinyan11
It is necessary that the callback be executed once during focus
Let's limit that only for comment linking. In other cases calling GetNewerActions
on focus is redundant
distanceFromStart returns the scroll distance that was scrolled before reaching the start and it always 0 on init
This didn't answer my question. I meant what's the purpose of this condition or what would go wrong if we don't add it
@janicduplessis Let's go with the RN patch + disabling GetNewerActions for non-comment-linked reports
Current situation:
Bug | RCA | Fixed in Regular reports? | Fixed in Comment-Linked reports? |
---|---|---|---|
GetNewerActions called multiple times on rendering report |
Bug in RN | No 🐛 | No 🐛 |
GetNewerActions called 1 time on focusing/blurring report |
Bug in RNW | No 🐛 | No 🐛 |
After @janicduplessis's solution:
Bug | RCA | Fixed in Regular reports? | Fixed in Comment-Linked reports? |
---|---|---|---|
GetNewerActions called multiple times on rendering report |
Bug in RN | Yes ✅ | Yes ✅ |
GetNewerActions called 1 time on focusing/blurring report |
Bug in RNW | Yes ✅ | No 🐛 |
For the remaining unresolved case, it requires a react-native-web upstream PR. From /App side the safest we can do is to prevent the call on blurring the report (partly fixing the issue, the call would still occur on focusing the report)
@janicduplessis Can you please raise a PR for both the patch and the suggested solution?
First PR is up, will do the patch one later today or tomorrow!
🎀 👀 🎀
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
This didn't answer my question. I meant what's the purpose of this condition or what would go wrong if we don't add it
@s77rt if distanceFromStart
is 0
this means that cllback is called without the user scrolling ( i.e. on rendering ). if we don't add it the callback will only be called when user first time reaches to the start, other reachings will have no effect
Now what should I do next?
I have https://github.com/facebook/react-native/pull/44287 ready, need to be reviewed by meta engineers. We could make a patch for it to use it now.
Thanks for the upstream PR @janicduplessis - feel free to open a PR with the patch.
Yes, planning to do that today!
@s77rt @roryabraham Here's the PR for the patch https://github.com/Expensify/App/pull/41189
@s77rt @janicduplessis - are we getting @shahinyan11 to do anything here? If not, I'm kind of willing to pay out $250 regardless for their help here.
Looks like the RN patch also fixed the RNW bug 🎉
I think we are good for this issue. Yes please pay out @shahinyan11 also for his help and work on this.
@janicduplessis @janicduplessis Thank you for appreciating my work
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.68-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-05-08. :confetti_ball:
For reference, here are some details about the assignees on this issue:
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:
Can we close this? i think the next steps will be handled in https://github.com/Expensify/App/issues/41153
@francoisl, @twisterdotcom, @s77rt Huh... This is 4 days overdue. Who can take care of this?
@twisterdotcom did you get a chance to issue the payments you had summarized in this comment?
This is paid already
Yes, we can close.
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.4.60-7 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 Expensify/Expensify Issue URL: Issue reported by: @quinthar Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1712180926567259
Action Performed:
Expected Result:
Shouldn't call
GetNewerActions
multiple timesActual Result:
GetNewerActions
called 5times, despite not scrolling anywhere. Also, all 5 calls seem identicalWorkaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @twisterdotcom