-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
correct logic of from
and to
for narrow layout in Shared
in Search
#44658
correct logic of from
and to
for narrow layout in Shared
in Search
#44658
Conversation
Initially, the reportItemSameIDs.mp4cc: @luacmartins |
Reviewer Checklist
Screenshots/VideosAndroid: Native44658_Android_mWeb.mp4Android: mWeb Chrome44658_Android_mWeb.mp4iOS: Native44658_iOS_native.moviOS: mWeb Safari44658_iOS_mWeb.movMacOS: Chrome / SafariScreen.Recording.2024-07-03.at.11.56.16.movMacOS: Desktop44658_Desktop.mov |
// We get the from and to details from the first transaction. The first transaction's from and to need not be the same | ||
// as the report's accountID and managerID. | ||
|
||
const participantFrom = reportItem.transactions[0].from?.accountID === reportItem?.accountID ? reportItem.transactions[0].from : reportItem.transactions[0].to; | ||
const participantTo = reportItem.transactions[0].to?.accountID === reportItem?.managerID ? reportItem.transactions[0].to : reportItem.transactions[0].from; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about why we have this check. Shouldn't we just use the reportItem from/to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reportItem
only has account IDs. We need display name, avatar etc. which are available in from
and to
fields of transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm can we update the reportItem to pass the personalDetails as well, like we do for transactions? I think that'd be cleaner and less confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That will make the code on front-end cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, let's update it then!
Yea, I'm ooo today but I'll work on a fix tomorrow when I'm back |
Thanks. Sorry, I accidentally deleted the previous comment. |
I haven't been able to reproduce this. @c3024 @brunovjk could you please list out the reproducible steps? |
I followed the same steps to test this PR, but I did not reproduce the error consistently. My mWeb are laggy, it's easy to briefly see narrow layout appear identical for a period at the end of the videos: |
I'm still not able to reproduce. The UI updates correctly for me once we receive the Search response Screen.Recording.2024-07-02.at.12.17.28.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump on this comment @c3024
from
and to
from transaction
after comparing account IDs in reportfrom
and to
for narrow layout in Shared
in Search
Re-testing |
Done! I am seeing this almost every time. Repro steps are same as mentioned in the PR author checklist. |
Exactly, the changes in the code are good for me, but I can also reproduce the issue al well. @c3024 do you think we can fix this in FE? Or just BE? |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest changes LGTM, I will approve it but this issue still appears in my tests. If necessary, I will review it again.
Oh interesting, any ideas why the merge is not happening correctly? |
I think we can merge this PR since the issue is not related to these changes. @c3024 could you still investigate the issue with the Onyx merge please? |
I have been trying but could not pin point on anything. There is a similar problem here in a Slack convo as well. |
Does that happen only when you already had bad data locally and we're updating the values? Or does it happen when you have no data (fresh login) and we merge values into Onyx for the first time? |
When I login afresh the IDs are fine and up to date. But when there is a new transaction which causes swap of IDs of a reportItem, this happens. |
Hmm I wonder if it's just taking time to write the data to Onyx and re-render the component then. I didn't observer this issue on my end. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.5-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.5-2 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
} else { | ||
reportIDToTransactions[reportKey] = {transactions: [transaction]}; | ||
reportIDToTransactions[reportKey].transactions = [transaction]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Details
In the narrow layout, the expense header may display incorrect
from
andto
values if the first transaction'sfrom
andto
differ from those in the net report. This PR addresses this issue.Fixed Issues
$ #44093
PROPOSAL: #44093 (comment)
Tests
Search
>Shared
.User A --> User B
in the header for this report.Search
>Shared
.User B --> User A
in the header for this report.Offline tests
NA
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
narrowAndroid.mp4
Android: mWeb Chrome
narrowAndroidmWeb.mp4
iOS: Native
narrowiOS.mp4
iOS: mWeb Safari
narrowiOSmWeb.mp4
MacOS: Chrome / Safari
narrowChrome.mp4
MacOS: Desktop
narrowDesktop.mp4