Closed lanitochka17 closed 5 months ago
Triggered auto assignment to @CortneyOfstad (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Was able to recreate, so going to get eyes on this 👍
Job added to Upwork: https://www.upwork.com/jobs/~01f9c0565b91f7e6d4
Current assignee @CortneyOfstad is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External
)
Chat - Several images at once are skipped when switching attachments with arrows
The prop maxToRenderPerBatch
of FlastList cause this issue. As mentioned in official React Native documentation, this prop maxToRenderPerBatch
is a VicualizedList
prop that can be passed through. The current modal attachment list is horizontal, so don't need this one.
Removing prop maxToRenderPerBatch
is a solution here .
N/A
Here is a video link after fixed: https://www.loom.com/share/bc5bb3fd5ec54a7daa52b405971688f1
@lanitochka17 maybe this issue is related to this one https://github.com/Expensify/App/issues/21177
@univalchemist as I understand Removing prop maxToRenderPerBatch
is setting it to default value. And after this there is that default Safari bug anyway. You can find it in your Loom video too. When you click on any image, 1st one displayed is image with cat (last image in your attachments) and then loaded correct image.
@mkarkachov , removing prop maxToRenderPerBatch
is not setting it to the default value. It does not have any default value and removing it means undefined
. Yes, this is just issue on Safari and it is related with this prop. Also notice that this prop affects in only the virtual list.
Not overdue 👍
The maxToRenderPerBatch
parameter is not added by accident; the chosen value plays a crucial role. Despite the fact that we only see one item at a time, two additional items are rendered on each side (outside of view). This effectively preloads the subsequent and previous attachments, preparing the content that the user is likely to interact with next.
The list's orientation, horizontal in this case, does not provide a valid reason for eliminating this property. The maxToRenderPerBatch
parameter is a vital part of virtualization, and it operates irrespective of the type of the list.
Furthermore, this property has a default value of 10
(see maxToRenderPerBatchOrDefault). This implies that removing the property would not solve the issue but merely displace it. It might also degrade loading as we'll start loading 10 images shortly after the carousel is opened
Erasing the property or augmenting the value of maxToRenderPerBatch
only masks the issue. This is because the problem would then only surface for conversations encompassing more than 10 attachments.
Not overdue
The
maxToRenderPerBatch
parameter is not added by accident; the chosen value plays a crucial role. Despite the fact that we only see one item at a time, two additional items are rendered on each side (outside of view). This effectively preloads the subsequent and previous attachments, preparing the content that the user is likely to interact with next.The list's orientation, horizontal in this case, does not provide a valid reason for eliminating this property. The
maxToRenderPerBatch
parameter is a vital part of virtualization, and it operates irrespective of the type of the list.Furthermore, this property has a default value of
10
(see maxToRenderPerBatchOrDefault). This implies that removing the property would not solve the issue but merely displace it. It might also degrade loading as we'll start loading 10 images shortly after the carousel is openedErasing the property or augmenting the value of
maxToRenderPerBatch
only masks the issue. This is because the problem would then only surface for conversations encompassing more than 10 attachments.
Ok, let's see who suggests another solution then!
Chat - Several images at once are skipped when switching attachments with arrows
The pagingEnabled
property in FlatList
caused the error. According to the react-native docs(Here), when pagingEnabled
property is true, the scroll view stops on multiples of the scroll view's size when scrolling. So, it seems like it is automatically scrolling when the next set of images are loaded.
However, pagingEnabled
property is necessary for mobile devices to use the paging behavior when swiping through images. So, we cannot completely remove that.
Setting the pagingEnabled
property to false
only for non-touch screens will fix the issue. (Here)
pagingEnabled={this.canUseTouchScreen}
None
📣 @AshenI99! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
In response to: https://github.com/Expensify/App/issues/22318#issuecomment-1634256318
@AshenI99, we utilize the pagingEnabled
property to facilitate the horizontal pagination of attachments, displaying them one at a time.
The existing documentation for this property might be somewhat terse, but it serves a key purpose: it allows for a portion of the view to be scrolled through. In our scenario, we scroll through exactly one page (equivalent to one ScrollView size), and this functions correctly most of the time.
What leads you to the conclusion that removing pagingEnabled
would resolve the issue? Wouldn't this modification also disrupt the current paging behavior?
Hi @kidroca,
You are right about that paging behavior when it comes to mobile devices. So, if we completely remove that, it'll affect the paging behavior of the mobile devices. However, when it comes to non-touch screens, paging behavior won't be an issue as a user is switching through attachments with arrows. So, it'll only switch one image at a time.
Therefore, we need to disable the pagingEnabled
only when it is a non-touchscreen such as desktops and laptops. So it'll be as follows,
pagingEnabled={this.canUseTouchScreen}
https://github.com/Expensify/App/assets/73756207/8fa9ecdc-eb18-4cdf-afc0-4e8dbd94d28d
@AshenI99
You are right about that paging behavior when it comes to mobile devices. So, if we completely remove that, it'll affect the paging behavior of the mobile devices. However, when it comes to non-touch screens, paging behavior won't be an issue as a user is switching through attachments with arrows. So, it'll only switch one image at a time.
I appreciate your observations. However, I need a bit more clarification on the specific role of pagingEnabled
in causing the issue at hand. You've pinpointed it as the root of the problem, yet an in-depth explanation is missing.
Could you shed light on the exact purpose of pagingEnabled
and why you believe it is only relevant to touch screens? Also, it's worth noting that even on touch screen devices, we still offer the arrow buttons to facilitate navigation. Wouldn't those users be susceptible to encountering the same bug as well?
From my perspective, this is beginning to appear like a bug with how pagingEnabled
functions in react-native-web, or perhaps it's related to our particular blend of property settings in conjunction with pagingEnabled
.
@kidroca
Yes. I think you are right. It could be either bug with how pagingEnabled
functions in react-native-web, or it could related to our particular blend of property settings in conjunction with pagingEnabled
.
Also this issue is happening in mobile browsers too. That case it is happening when we use swipe action to swipe through images instead of using arrows.
Seems the following react-native-web bug might be related
The video provided in the issue description depicts a behavior with content jumping to the start of the list as the user scrolls to the right. I think it's similar to what happens in our case. The content seem to jump to the start of the virtual list
@rushatgabhane thoughts on the above? ^^^
@rushatgabhane Bump ^^^
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@CortneyOfstad @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@rushatgabhane any update on the above?
Agree! It looks like it's an underlying issue with react native web https://github.com/necolas/react-native-web/issues/2026
@rushatgabhane Do we think any of the proposals above could help with this, or do we still need some new ones?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@CortneyOfstad @rushatgabhane this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
See here? No anyone suggests a good solution than this I am sure there is not any good way to fix this issue than my proposal.
@rushatgabhane Do we think any of the proposals above could work?
Heading OoO until 8/14, so reassigning BZ to keep an eye on this.
@rushatgabhane bump on the proposals above ^^^^
Triggered auto assignment to @MitchExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)waiting for proposals to fix
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@CortneyOfstad @rushatgabhane @MitchExpensify this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @rushatgabhane is eligible for the Internal assigner, not assigning anyone new.
@CortneyOfstad, @rushatgabhane, @MitchExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Is this still the latest on this one @rushatgabhane ?
waiting for proposals to fix
Friendly bump on this question @rushatgabhane
waiting for proposals to fix https://github.com/necolas/react-native-web/issues/2026
@MitchExpensify yes! this is the latest - https://github.com/Expensify/App/issues/22318#issuecomment-1660967959
Hi @MitchExpensify -- back from OoO so I can take this back over. Thanks for holding down the fort while I was gone 👍
Sounds gooood! Thanks, @CortneyOfstad
No updates yet 👍
@rushatgabhane Just checking to see where we're at with this — TIA!
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Only the next attachment is loaded by clicking on the on-screen arrow
Actual Result:
Several images at once are skipped when switching attachments with on-screen arrows
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.37.2
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
https://github.com/Expensify/App/assets/78819774/788b44a2-3d0e-4ab4-acab-9894019f42d4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit