-
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
(2/2) ChatListItem to ReportActionItem V2 #57819
base: main
Are you sure you want to change the base?
(2/2) ChatListItem to ReportActionItem V2 #57819
Conversation
… - use ReportActionItem in ChatListItem" This reverts commit 9ed2a28.
…x/51296-chat-list-item-v2
…x/51296-chat-list-item-v2
…x/51296-chat-list-item-v2
…x/51296-chat-list-item-v2
@luacmartins @allgandalf Regarding this issue #57343 We have this function to determine if an action deleted src/libs/ReportActionsUtils.ts function isDeletedAction(reportAction: OnyxInputOrEntry<ReportAction | OptimisticIOUReportAction>): boolean {
const message = reportAction?.message ?? [];
if (!Array.isArray(message)) {
return message?.html === '' || !!message?.deleted;
}
// A legacy deleted comment has either an empty array or an object with html field with empty string as value
const isLegacyDeletedComment = message.length === 0 || message.at(0)?.html === '';
return isLegacyDeletedComment || !!message.at(0)?.deleted;
} That function is being used in But it will return true when the onyx is not ready, do you have any suggestion to make it more accurate? The inaccurate result will show not found page for a brief moment especially when we clear onyx data / reset first edit: @blazejkustra I've noticed that we have function isDeletedAction(reportAction: OnyxInputOrEntry<ReportAction | OptimisticIOUReportAction>): boolean {
const message = reportAction?.message ?? [];
if (!Array.isArray(message)) {
return (message?.html === '' || !!message?.deleted) && !reportAction?.shouldShow;
}
// A legacy deleted comment has either an empty array or an object with html field with empty string as value
const isLegacyDeletedComment = message.length === 0 || message.at(0)?.html === '';
return (isLegacyDeletedComment || !!message.at(0)?.deleted) && !reportAction?.shouldShow;
} |
I see myself in the git blame, but it was because I created this Onyx type when we were migrating the app to Typescript. As per comment: /** TODO: Not enough context */
shouldShow?: boolean; I don't have context what this property does 😅 |
@wildan-m I think that function is fine and I'm not sure that the function itself should be aware of data being available in Onyx or not. Can we prevent calling it outside of the function if Onyx is not ready? |
…x/51296-chat-list-item-v2
@luacmartins this property missing from report which will cause #57344 "invoiceReceiver": {
"accountID": 11646283,
"type": "individual"
}, If possible, could we align the snapshot's report/reportAction/transaction property with the live data to guarantee consistency and avoid future regressions? |
For #57357 I think close action shouldn't be shown in the serch results, since the action will not acually visible, it's meta action like create action So I solve it by if (isDeletedAction(reportAction) || isResolvedActionableWhisper(reportAction) || reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED || isCreatedAction(reportAction)) {
// eslint-disable-next-line no-continue
continue;
} Please let me know if you know other invisible reportaction types |
#57363 probably BE, I couldn't reproduce it while offline Kapture.2025-03-06.at.15.51.23.mp4 |
Update: BE Pending BE issue |
I got a PR in review to fix this. The idea with the snapshot data is that we send as little as possible back for performance reasons. I don't think we should blindly add all keys to it. |
This seems fine. |
I got a PR for this one too #57819 (comment) |
Update: WIP BE Pending BE issue |
Regarding #57343 isLoadingInitialReportActions is being set to false earlier when open the chatListItem, so it will show |
I'll work on a fix for that tomorrow. |
…x/51296-chat-list-item-v2
There is another issue regarding error message in the search result. When we clicking the close button the message in the snapshot is not automatically cleared because it currently only clear live onyx. my question is -- should we really need to show the error message in search result?
|
@wildan-m I think it's fine to hide it on Search. We don't currently show other errors either
Is this not happening because of a key name mismatch between live Onyx and snapshot? |
I'm unable to reproduce this one. I never see the modified expense report action. @wildan-m are you able to reproduce it? |
…x/51296-chat-list-item-v2
@luacmartins The change message is no longer present in the snapshot, making it non-reproducible. Was this change intentional? If that's on purpose then we can say it's resolved. |
Unlike onyx update, I believe that onyx.merge/onyx.set does not automatically update corresponding data under the |
Yea, I think we can leave those system messages out. |
Hmm it should. If we have a matching key in |
@wildan-m from the list of issues, it seems like only these 3 are left, right?
|
…rror messages when app fails to delete expense
…x/51296-chat-list-item-v2
@luacmartins I've inspected the merge function, but couldn't find related code to update snapshot |
Just resolved prettier, lint and unit test errors, If all BE completed, I think we have resolved all issues edit: wait, I've found new concierge task issue, seems some properties missing. Investigating.... Kapture.2025-03-22.at.15.42.44.mp4 |
This problem is caused by the absence of 'childManagerAccountID' in the snapshot. |
@wildan-m the code to update the snapshots is called here
Investigating |
PR in review |
…x/51296-chat-list-item-v2
Explanation of Change
Fixed Issues
$ #51296
$ #57340
$ #57344
$ #57347
$ #57352
$ #57357
$ #57363
PROPOSAL: #51296 (comment)
Tests
Pre-condition: Login to account with various chat types
Also Verify these issues resolved:
$ #51296
$ #57340
$ #57344
$ #57347
$ #57352
$ #57357
$ #57363
Offline tests
Same as test
QA Steps
Same as test
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop