@@ -1133,7 +1133,7 @@ const supportedActionTypes = new Set<ReportActionName>([...Object.values(otherAc
11331133 * Checks whether an action is actionable track expense and resolved.
11341134 *
11351135 */
1136- function isResolvedActionableWhisper ( reportAction : OnyxEntry < ReportAction > , allActionsForReport ?: OnyxEntry < ReportActions > ) : boolean {
1136+ function isResolvedActionableWhisper ( reportAction : OnyxEntry < ReportAction > ) : boolean {
11371137 const originalMessage = getOriginalMessage ( reportAction ) ;
11381138 if ( ! originalMessage || typeof originalMessage !== 'object' ) {
11391139 return false ;
@@ -1148,25 +1148,6 @@ function isResolvedActionableWhisper(reportAction: OnyxEntry<ReportAction>, allA
11481148 return false ;
11491149 }
11501150
1151- // For mention whispers, only treat as deleted if the parent comment is also deleted.
1152- // This distinguishes cascade deletion (parent deleted -> whisper should hide) from
1153- // the backend's one-per-user cleanup (parent still exists -> whisper should stay visible).
1154- if ( reportAction ?. reportActionID && ( isActionableMentionWhisper ( reportAction ) || isActionableReportMentionWhisper ( reportAction ) ) ) {
1155- const reportID = reportAction . reportID ;
1156- const actions = allActionsForReport ?? ( reportID ? allReportActions ?. [ `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ reportID } ` ] : undefined ) ;
1157- if ( actions ) {
1158- // Prefer the stored reportActionID from the whisper's originalMessage when available (set for
1159- // whispers created during message edits, which don't follow the parentID+1 ID convention).
1160- // Fall back to offset arithmetic for legacy whispers that predate this field.
1161- const storedParentID = isActionableMentionWhisper ( reportAction ) ? ( originalMessage as { parentReportActionID ?: string } ) . parentReportActionID : undefined ;
1162- const parentActionID = storedParentID ?? String ( BigInt ( reportAction . reportActionID ) - ( isActionableReportMentionWhisper ( reportAction ) ? 2n : 1n ) ) ;
1163- const parentAction = actions [ parentActionID ] ;
1164- if ( parentAction && ! isDeletedAction ( parentAction ) ) {
1165- return false ;
1166- }
1167- }
1168- }
1169-
11701151 return true ;
11711152}
11721153
@@ -1192,13 +1173,7 @@ function isResolvedConciergeDescriptionOptions(reportAction: OnyxEntry<ReportAct
11921173 * Checks if a reportAction is fit for display, meaning that it's not deprecated, is of a valid
11931174 * and supported type, it's not deleted and also not closed.
11941175 */
1195- function shouldReportActionBeVisible (
1196- reportAction : OnyxEntry < ReportAction > ,
1197- key : string | number ,
1198- canUserPerformWriteAction ?: boolean ,
1199- reportsParam ?: OnyxCollection < Report > ,
1200- allActionsForReport ?: OnyxEntry < ReportActions > ,
1201- ) : boolean {
1176+ function shouldReportActionBeVisible ( reportAction : OnyxEntry < ReportAction > , key : string | number , canUserPerformWriteAction ?: boolean , reportsParam ?: OnyxCollection < Report > ) : boolean {
12021177 if ( ! reportAction ) {
12031178 return false ;
12041179 }
@@ -1278,7 +1253,7 @@ function shouldReportActionBeVisible(
12781253 }
12791254
12801255 // If action is actionable whisper and resolved by user, then we don't want to render anything
1281- if ( isActionableWhisper ( reportAction ) && isResolvedActionableWhisper ( reportAction , allActionsForReport ) ) {
1256+ if ( isActionableWhisper ( reportAction ) && isResolvedActionableWhisper ( reportAction ) ) {
12821257 return false ;
12831258 }
12841259
@@ -1322,27 +1297,22 @@ function isReportActionVisible(
13221297 return false ;
13231298 }
13241299
1325- // Look up all actions for this report so the parent-check in isResolvedActionableWhisper
1326- // can determine whether a whisper's `deleted` flag reflects a real cascade deletion
1327- // (parent comment deleted) vs. the backend's one-per-user cleanup (parent still exists).
1328- const reportActionsForReport = allReportActions ?. [ `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ reportID } ` ] ;
1329-
13301300 // Actions with pendingAction are optimistic or in-flight, so their visibility may differ
13311301 // from what's cached in visibleReportActions (which reflects persisted Onyx data).
13321302 // We must recalculate visibility at runtime to ensure accuracy for these transient states.
13331303 if ( reportAction . pendingAction ) {
1334- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1304+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13351305 }
13361306
13371307 if ( visibleReportActions && reportID ) {
13381308 const reportCache = visibleReportActions [ reportID ] ;
13391309 if ( ! reportCache ) {
1340- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1310+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13411311 }
13421312 const staticVisibility = reportCache [ reportAction . reportActionID ] ;
13431313 // If action is not in derived value cache, fall back to runtime calculation
13441314 if ( staticVisibility === undefined ) {
1345- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1315+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13461316 }
13471317 if ( ! staticVisibility ) {
13481318 return false ;
@@ -1352,7 +1322,7 @@ function isReportActionVisible(
13521322 }
13531323 return true ;
13541324 }
1355- return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction , undefined , reportActionsForReport ) ;
1325+ return shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , canUserPerformWriteAction ) ;
13561326}
13571327
13581328/**
0 commit comments