@@ -1130,7 +1130,7 @@ const supportedActionTypes = new Set<ReportActionName>([...Object.values(otherAc
11301130 * Checks whether an action is actionable track expense and resolved.
11311131 *
11321132 */
1133- function isResolvedActionableWhisper ( reportAction : OnyxEntry < ReportAction > , allActionsForReport ?: OnyxEntry < ReportActions > ) : boolean {
1133+ function isResolvedActionableWhisper ( reportAction : OnyxEntry < ReportAction > ) : boolean {
11341134 const originalMessage = getOriginalMessage ( reportAction ) ;
11351135 if ( ! originalMessage || typeof originalMessage !== 'object' ) {
11361136 return false ;
@@ -1145,25 +1145,6 @@ function isResolvedActionableWhisper(reportAction: OnyxEntry<ReportAction>, allA
11451145 return false ;
11461146 }
11471147
1148- // For mention whispers, only treat as deleted if the parent comment is also deleted.
1149- // This distinguishes cascade deletion (parent deleted -> whisper should hide) from
1150- // the backend's one-per-user cleanup (parent still exists -> whisper should stay visible).
1151- if ( reportAction ?. reportActionID && ( isActionableMentionWhisper ( reportAction ) || isActionableReportMentionWhisper ( reportAction ) ) ) {
1152- const reportID = reportAction . reportID ;
1153- const actions = allActionsForReport ?? ( reportID ? allReportActions ?. [ `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ reportID } ` ] : undefined ) ;
1154- if ( actions ) {
1155- // Prefer the stored reportActionID from the whisper's originalMessage when available (set for
1156- // whispers created during message edits, which don't follow the parentID+1 ID convention).
1157- // Fall back to offset arithmetic for legacy whispers that predate this field.
1158- const storedParentID = isActionableMentionWhisper ( reportAction ) ? ( originalMessage as { parentReportActionID ?: string } ) . parentReportActionID : undefined ;
1159- const parentActionID = storedParentID ?? String ( BigInt ( reportAction . reportActionID ) - ( isActionableReportMentionWhisper ( reportAction ) ? 2n : 1n ) ) ;
1160- const parentAction = actions [ parentActionID ] ;
1161- if ( parentAction && ! isDeletedAction ( parentAction ) ) {
1162- return false ;
1163- }
1164- }
1165- }
1166-
11671148 return true ;
11681149}
11691150
@@ -1189,13 +1170,7 @@ function isResolvedConciergeDescriptionOptions(reportAction: OnyxEntry<ReportAct
11891170 * Checks if a reportAction is fit for display, meaning that it's not deprecated, is of a valid
11901171 * and supported type, it's not deleted and also not closed.
11911172 */
1192- function shouldReportActionBeVisible (
1193- reportAction : OnyxEntry < ReportAction > ,
1194- key : string | number ,
1195- canUserPerformWriteAction ?: boolean ,
1196- reportsParam ?: OnyxCollection < Report > ,
1197- allActionsForReport ?: OnyxEntry < ReportActions > ,
1198- ) : boolean {
1173+ function shouldReportActionBeVisible ( reportAction : OnyxEntry < ReportAction > , key : string | number , canUserPerformWriteAction ?: boolean , reportsParam ?: OnyxCollection < Report > ) : boolean {
11991174 if ( ! reportAction ) {
12001175 return false ;
12011176 }
@@ -1275,7 +1250,7 @@ function shouldReportActionBeVisible(
12751250 }
12761251
12771252 // If action is actionable whisper and resolved by user, then we don't want to render anything
1278- if ( isActionableWhisper ( reportAction ) && isResolvedActionableWhisper ( reportAction , allActionsForReport ) ) {
1253+ if ( isActionableWhisper ( reportAction ) && isResolvedActionableWhisper ( reportAction ) ) {
12791254 return false ;
12801255 }
12811256
@@ -1319,27 +1294,22 @@ function isReportActionVisible(
13191294 return false ;
13201295 }
13211296
1322- // Look up all actions for this report so the parent-check in isResolvedActionableWhisper
1323- // can determine whether a whisper's `deleted` flag reflects a real cascade deletion
1324- // (parent comment deleted) vs. the backend's one-per-user cleanup (parent still exists).
1325- const reportActionsForReport = allReportActions ?. [ `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ reportID } ` ] ;
1326-
13271297 // Actions with pendingAction are optimistic or in-flight, so their visibility may differ
13281298 // from what's cached in visibleReportActions (which reflects persisted Onyx data).
13291299 // We must recalculate visibility at runtime to ensure accuracy for these transient states.
13301300 if ( reportAction . pendingAction ) {
1331- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1301+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13321302 }
13331303
13341304 if ( visibleReportActions && reportID ) {
13351305 const reportCache = visibleReportActions [ reportID ] ;
13361306 if ( ! reportCache ) {
1337- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1307+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13381308 }
13391309 const staticVisibility = reportCache [ reportAction . reportActionID ] ;
13401310 // If action is not in derived value cache, fall back to runtime calculation
13411311 if ( staticVisibility === undefined ) {
1342- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1312+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13431313 }
13441314 if ( ! staticVisibility ) {
13451315 return false ;
@@ -1349,7 +1319,7 @@ function isReportActionVisible(
13491319 }
13501320 return true ;
13511321 }
1352- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1322+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13531323}
13541324
13551325/**
0 commit comments