-
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
[HOLD on #15212] Bug: Mark as unread state vanishes after closing the app in IOS app @chauchausoup #11515
Comments
Reproduced in staging. It "fixes" itself once but not twice. RPReplay_Final1667235547.mov |
Triggered auto assignment to @conorpendergrast ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
Triggered auto assignment to @flodnv ( |
ProposalProblemThis issue happens on both mWeb and native Screen.Recording.2022-11-01.at.20.12.04.mp4In App/src/pages/home/ReportScreen.js Line 222 in 78d322f
We use In App/src/pages/home/report/ReportActionsView.js Lines 91 to 101 in 78d322f
we just unsubscribe visibilityListener when unMount, but chat's still there when user goes back to home (home is just the drawer). Besides, Freeze prevents the components re-render => App/src/pages/home/report/ReportActionsView.js Lines 254 to 258 in 78d322f
SolutionSolution 1:In Use setTimeout to trigger freeze => That makes this.state = {
skeletonViewContainerHeight: reportActionsListViewHeight,
viewportOffsetTop: 0,
isBannerVisible: true,
+ freeze:false
};
...
componentDidUpdate(prevProps) {
+ const shouldEnableFreeze = this.props.isSmallScreenWidth && this.props.isDrawerOpen;
+ if(!this.state.freeze && shouldEnableFreeze){
+ setTimeout(()=>{
+ this.setState({freeze:true})
+ },100)
+ }else if(this.state.freeze && !shouldEnableFreeze){
+ this.setState({freeze:false})
+ }
if (this.props.route.params.reportID === prevProps.route.params.reportID) {
return;
}
...
<Freeze
- freeze={this.props.isSmallScreenWidth && this.props.isDrawerOpen}
+ freeze={this.state.freeze} Solution 2:I'll create In this.state = {
isFloatingMessageCounterVisible: false,
newMarkerSequenceNumber: ReportUtils.isUnread(props.report)
? props.report.lastReadSequenceNumber + 1
: 0,
+ freeze:false
};
...
+ componentDidUpdate(prevProps) {
...
+ const shouldEnableFreeze = this.props.isSmallScreenWidth && this.props.isDrawerOpen;
+ if(!this.state.freeze && shouldEnableFreeze){
+ this.setState({freeze:true})
+ this.props.enableFreeze(true)
+ }else if(this.state.freeze && !shouldEnableFreeze){
+ this.setState({freeze:false})
+ }
} In this.state = {
skeletonViewContainerHeight: reportActionsListViewHeight,
viewportOffsetTop: 0,
isBannerVisible: true,
+ freeze:false
};
...
componentDidUpdate(prevProps) {
+ const shouldEnableFreeze = this.props.isSmallScreenWidth && this.props.isDrawerOpen;
+ if(this.state.freeze && !shouldEnableFreeze){
+ this.setState({freeze:false})
+ } Screen.Recording.2022-11-01.at.20.10.21.mp4 |
@rushatgabhane Over to you, for the proposal review! |
Oh wait this needs to be reproduced on production too! |
@flodnv i don't know if we're fixing the root cause in solution 2. Are we using the Is there a better solution to abstract this logic? Otherwise we'll have to keep doing this whenever Freeze component is used |
FWIW, this issue also seems to affect Android (I've tested on my phone) I'll be honest, I don't really understand the problem. @tienifr can you please edit your problem statement description to be more readable (by someone who doesn't know anything)? Or @rushatgabhane if you understand the problem, can you rephrase it in your own words? |
@flodnv I just follow the lib docs here: https://www.npmjs.com/package/react-freeze App/src/pages/home/ReportScreen.js Lines 291 to 297 in 78d322f
=> This function: App/src/pages/home/report/ReportActionsView.js Lines 254 to 258 in 78d322f
still use the stale isDrawerOpen prop is false (that should be true when user click any chat) => getIsReportFullyVisible returns false.
So when user switches tabs, event App/src/pages/home/report/ReportActionsView.js Lines 92 to 101 in 78d322f
|
@flodnv pls let me know if it's still hard to understand. Sorry about that, It's quite hard for me to explain this case |
Ok, what I am not following is why the unread state isn't persisted then (If I close my app and reopen, it's still not marked as unread)? Is the API not getting called because something is frozen? |
The API is still getting called but the props/states of frozen component is not updated |
This is also on HOLD for #15212 |
Progress is happening in #15212 |
Still waiting on continued progress in #15212 |
@chauchausoup do you mind re-testing this issue using your reproduction steps. I think we're to the point where this might now be fixed. Please share a video, similar to the original issue post. |
Waiting for re-test, same as above. |
This issue should be fixed! We can retest and most probably close it |
@kavimuru are you able to retest this to confirm please? |
That sounds good. Or @chauchausoup if you're free, please re-test and include a video and we can make sure you're paid out! Thanks. |
Same as above. |
Sorry guys for the delayed reply. I will retest the issue now. |
📣 @chauchausoup! 📣
|
Still waiting on confirmation. |
On hold for navigation improvements through #11768
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:
Since it was marked as unread, user thinks that the message should be bold but it’s not showing that remark as expected.
Actual Result:
Bold remark in Unread message is vanished.
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.11-0
Reproducible in staging?: Yes #11515 (comment)
Reproducible in production?: Needs reproduction
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
RPReplay_Final1664605493.MP4
KUTO7893.1.MP4
Expensify/Expensify Issue URL:
Issue reported by: @chauchausoup
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1664605579764649
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: