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
iOS - Previous conversation is briefly visible when opening a new chat #3729
ISSUE: on iOS staging:
tap into a chat
tap back to the home screen
tap into a different chat
the last chat you were in will flash on the screen before the new chat shows
our component is remounted whenever we change our reportID
It seems like this was not the intention when this PR was written, and I wonder if this is the real source of the issue. Do you know why the ReportScreen remounts entirely when the reportID changes? I see that the parent component is only passing a reportID as a route param, but why would changing the route prop trigger a full remount of the component?
I don't think the remount is the cause since our ComponentDidUpdate would do the same thing as ComponentDidMount does (in case our reportChanged check ever returned true).
i.e remounting is also calling this.prepareTransition() correctly when we change reports, and adding a few logs shows that our FullScreenLoadingIndicator is also being set to visible as it should.
I think the problem is really that we're trying to render both the FullScreenLoadingIndicator and the ReportView while loading. So if our ReportView takes 300ms or more to be painted, our LoadingIndicator isn't shown at all and we're stuck on the old ReportView during the whole transition.
I'll talk a bit about the remounts in the next comment.
Do you know why the ReportScreen remounts entirely when the reportID changes? I see that the parent component is only passing a reportID as a route param, but why would changing the route prop trigger a full remount of the component?
Hmmm okay thanks for digging into this some more @rdjuric. I think that good enough for me to agree that we should just take the path of least resistance and move forward with your original proposed solution. Feel free to submit a PR once you're been hired on Upwork.
Shouldn't this issue have been closed once the PR was merged or when it hit production? @MitchExpensify , can you review, pay in Upwork then close this issue?
I went to do it in Upwork but saw this message from you and got confused
Shouldn't this issue have been closed once the PR was merged or when it hit production? @MitchExpensify , can you review, pay in Upwork then close this issue?
I went to do it in Upwork but saw this message from you and got confused
I think this is the message I sent to mitch on Upwork 😅
@rdjuric thanks for comment, makes sense now. @arielgreen going back to 'shouldn't this issue have been closed' - Our new process will NOT close the issue so what I should have said was 'shouldn't an automated comment have been added stating that the PR had been merged?
Also, our new process will be adding Awaiting payment and Weekly labels to issue once the PR is merged so that contributor managers will know to pay in a week
@mallenexpensify ah, yeah I think you're correct; might be due to what @MonilBhavsar was saying elsewhere, that since this is an older issue it wasn't in the DB so it didn't get the automated comment.
Activity
MelvinBot commentedon Jun 23, 2021
Triggered auto assignment to @roryabraham (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.MelvinBot commentedon Jun 25, 2021
Triggered auto assignment to @MitchExpensify (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.roryabraham commentedon Jun 25, 2021
Sorry for the delay here, let's get this on Upwork!
rdjuric commentedon Jul 1, 2021
For posterity's sake: We had another issue #2154 open for this before, and a PR #2221 was made to try and fix it.
I think one of the problems with our current fix is that this code block is never executed the way we intended
https://github.com/Expensify/Expensify.cash/blob/c5707430dff9ecfb631012bb0ba25357c7f367e5/src/pages/home/ReportScreen.js#L37-L44
That's because our component is remounted whenever we change our reportID and the
ComponentDidUpdatelifecycle isn't called on the first render. This means that in our implementation, every timeComponentDidUpdateis called our component will have updated its props already (prevProps === this.props) and ourreportChangedcheck will always return false.Proposal
ComponentDidUpdatelifecycleReportViewhere, something like{!this.shouldShowLoader() && <ReportView reportID={this.getReportID()} />}Simulator.Screen.Recording.-.iPhone.SE.14.5.-.2021-07-01.at.02.21.29.mp4
roryabraham commentedon Jul 1, 2021
Thanks for the explanation @rdjuric!
It seems like this was not the intention when this PR was written, and I wonder if this is the real source of the issue. Do you know why the
ReportScreenremounts entirely when thereportIDchanges? I see that the parent component is only passing a reportID as a route param, but why would changing therouteprop trigger a full remount of the component?rdjuric commentedon Jul 1, 2021
@roryabraham Good questions!
I don't think the remount is the cause since our
ComponentDidUpdatewould do the same thing asComponentDidMountdoes (in case ourreportChangedcheck ever returned true).i.e remounting is also calling
this.prepareTransition()correctly when we change reports, and adding a few logs shows that our FullScreenLoadingIndicator is also being set to visible as it should.I think the problem is really that we're trying to render both the
FullScreenLoadingIndicatorand theReportViewwhile loading. So if ourReportViewtakes 300ms or more to be painted, our LoadingIndicator isn't shown at all and we're stuck on the oldReportViewduring the whole transition.I'll talk a bit about the remounts in the next comment.
rdjuric commentedon Jul 1, 2021
It's not the prop change that is triggering the remount (the parent is also being remounted), but the way we navigate in our drawer navigator. This reset here causes the remounts.
https://github.com/Expensify/Expensify.cash/blob/870c3db1675bb294c8961a8db88bc1ffa276dea9/src/libs/Navigation/CustomActions.js#L27-L35
I modified it a bit so that it would stop remounting our routes and this issue kept happening
iOSNoRemount.mp4
MitchExpensify commentedon Jul 1, 2021
My bad for the delay! Missed the "external" assignment on this one, here's the Upwork job.
roryabraham commentedon Jul 2, 2021
Hmmm okay thanks for digging into this some more @rdjuric. I think that good enough for me to agree that we should just take the path of least resistance and move forward with your original proposed solution. Feel free to submit a PR once you're been hired on Upwork.
@MitchExpensify feel free to hire @rdjuric if/when he applies on Upwork.
MitchExpensify commentedon Jul 2, 2021
Hired!
rdjuric commentedon Jul 7, 2021
Sorry for the delay here @roryabraham! PR is up at #3908
roryabraham commentedon Jul 8, 2021
Merged!
mallenexpensify commentedon Jul 20, 2021
Shouldn't this issue have been closed once the PR was merged or when it hit production?

@MitchExpensify , can you review, pay in Upwork then close this issue?
I went to do it in Upwork but saw this message from you and got confused
rdjuric commentedon Jul 20, 2021
I think this is the message I sent to mitch on Upwork 😅
MitchExpensify commentedon Jul 20, 2021
Paid! Apologies for the delay @rdjuric
mallenexpensify commentedon Jul 20, 2021
@rdjuric thanks for comment, makes sense now.
@arielgreen going back to 'shouldn't this issue have been closed' - Our new process will NOT close the issue so what I should have said was 'shouldn't an automated comment have been added stating that the PR had been merged?
Also, our new process will be adding
Awaiting paymentandWeeklylabels to issue once the PR is merged so that contributor managers will know to pay in a weekarielgreen commentedon Jul 20, 2021
@mallenexpensify ah, yeah I think you're correct; might be due to what @MonilBhavsar was saying elsewhere, that since this is an older issue it wasn't in the DB so it didn't get the automated comment.