You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-04-09] [$500] Scroll position jumps to new data each time new data comes in debug console #38155
changed the title [-]Scroll position jumps to new data each time new data comes in debug console[/-][+][$500] Scroll position jumps to new data each time new data comes in debug console[/+]on Mar 14, 2024
Please re-state the problem that we are trying to solve in this issue.
Scrolls to the new data postion
What is the root cause of that problem?
We're using regular FlatList with invertedhere, by default it doesn't have functionality to preserve scroll position when there's new content.
What changes do you think we should make in order to solve the problem?
Use our custom InvertedFlatList instead (same one used by our report actions list here). We can use it similar to how we're using in report actions list.
The InvertedFlatList was built to work on all platforms, including web.
We also need to set the key for the log here, currently the logsList does not have any key, so the FlatList has no property to use for keyExtractor leading to the behavior not working.
What alternative solutions did you explore? (Optional)
Set the maintainVisibleContentPosition to the FlatList, but it doesn't work for web since react-native-web doesn't seem to support it, that's why we had to build our own MVCPFlatListhere (which has full support for the behavior in web), and MVCPFlatList is internally used by InvertedFlatList
changed the title [-][$500] Scroll position jumps to new data each time new data comes in debug console[/-][+][HOLD for payment 2024-04-09] [$500] Scroll position jumps to new data each time new data comes in debug console[/+]on Apr 2, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@getusha] The PR that introduced the bug has been identified. Link to the PR:
[@getusha] 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:
[@getusha] 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:
[@getusha] Determine if we should create a regression test for this bug.
[@getusha] 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.
[@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
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:
[@getusha] 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: N/a
[@getusha] Determine if we should create a regression test for this bug. No a minor issue.
[@getusha] 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. N/a
Activity
melvin-bot commentedon Mar 12, 2024
Triggered auto assignment to @puneetlath (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.ShridharGoel commentedon Mar 12, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Scroll position jumps to new data each time new data comes in debug console
What is the root cause of that problem?
Inverted list is being used - it is the common behaviour where inverted FlatList scrolls to bottom on adding new content.
App/src/pages/settings/AboutPage/ConsolePage.tsx
Lines 139 to 145 in c05ce47
What changes do you think we should make in order to solve the problem?
Option 1:
Use
maintainVisibleContentPositionprop like this:Option 2:
Use some library like this or this.
[-]Scroll position jumps to new data each time new data comes in debug console[/-][+][$500] Scroll position jumps to new data each time new data comes in debug console[/+]melvin-bot commentedon Mar 14, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01b144dad7ad88d8ed
melvin-bot commentedon Mar 14, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)puneetlath commentedon Mar 14, 2024
Opening up for proposals.
tienifr commentedon Mar 15, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Scrolls to the new data postion
What is the root cause of that problem?
We're using regular
FlatListwithinvertedhere, by default it doesn't have functionality to preserve scroll position when there's new content.What changes do you think we should make in order to solve the problem?
Use our custom
InvertedFlatListinstead (same one used by our report actions list here). We can use it similar to how we're using in report actions list.The
InvertedFlatListwas built to work on all platforms, including web.We also need to set the
keyfor the log here, currently thelogsListdoes not have any key, so the FlatList has no property to use forkeyExtractorleading to the behavior not working.We can do something like:
What alternative solutions did you explore? (Optional)
Set the
maintainVisibleContentPositionto theFlatList, but it doesn't work for web sincereact-native-webdoesn't seem to support it, that's why we had to build our ownMVCPFlatListhere (which has full support for the behavior in web), andMVCPFlatListis internally used byInvertedFlatList17 remaining items
[-][$500] Scroll position jumps to new data each time new data comes in debug console[/-][+][HOLD for payment 2024-04-09] [$500] Scroll position jumps to new data each time new data comes in debug console[/+]melvin-bot commentedon Apr 2, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 2, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 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 2024-04-09. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 2, 2024
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:
puneetlath commentedon Apr 8, 2024
@getusha bump on the checklist so that we can pay tomorrow.
melvin-bot commentedon Apr 9, 2024
Payment Summary
Upwork Job
BugZero Checklist (@puneetlath)
getusha commentedon Apr 10, 2024
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:
puneetlath commentedon Apr 10, 2024
Great thanks. @tienifr @getusha sent you both Upwork offers. Please comment here when you've accepted.
getusha commentedon Apr 10, 2024
@puneetlath accepted
puneetlath commentedon Apr 10, 2024
All paid. Thanks y'all!