-
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 |
This one is deployed and should be fixed. This one was merged and is pending deploy (probably on monday)
Where do we set it? |
In the openReport success data
…On Fri, Mar 7, 2025, 20:28 Carlos Martins ***@***.***> wrote:
#57344 <#57344> (#57819 (comment)
<#57819 (comment)>)
This one is deployed and should be fixed.
#57363 <#57363> (#57819 (comment)
<#57819 (comment)>)
This one was merged and is pending deploy (probably on monday)
isLoadingInitialReportActions is being set to false earlier when open the
chatListItem, so it will show Not Found / No Activity for a brief moment
any suggestion to solve it?
Where do we set it?
—
Reply to this email directly, view it on GitHub
<#57819 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2MM37Q6MBV3YCNGHZ6LHL2TGNGPAVCNFSM6AAAAABYLJFNXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBWGQ2TKNZVHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: luacmartins]*luacmartins* left a comment (Expensify/App#57819)
<#57819 (comment)>
#57344 <#57344> (#57819 (comment)
<#57819 (comment)>)
This one is deployed and should be fixed.
#57363 <#57363> (#57819 (comment)
<#57819 (comment)>)
This one was merged and is pending deploy (probably on monday)
isLoadingInitialReportActions is being set to false earlier when open the
chatListItem, so it will show Not Found / No Activity for a brief moment
any suggestion to solve it?
Where do we set it?
—
Reply to this email directly, view it on GitHub
<#57819 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2MM37Q6MBV3YCNGHZ6LHL2TGNGPAVCNFSM6AAAAABYLJFNXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBWGQ2TKNZVHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@wildan-m do you know why we're setting |
…x/51296-chat-list-item-v2
Now, the issue only showing The issue occurred only when we have one invite message If we have at least two message, the issue is gone I think there is a race condition between applying success data and applying the onyxUpdates. Kapture.2025-03-08.at.13.54.09.mp4 |
Explanation of Change
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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