From a1afb7f08790c228d4da16f79d23a4e461886bb6 Mon Sep 17 00:00:00 2001
From: Rohit Verma <rv17837@outlook.com>
Date: Fri, 21 Mar 2025 16:17:53 +0530
Subject: [PATCH 1/6] fix(chats): unread marker displays when sending payment
 elsewhere

---
 src/pages/home/report/ReportActionsList.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx
index 6ceb6a296fec..ad85009a5909 100644
--- a/src/pages/home/report/ReportActionsList.tsx
+++ b/src/pages/home/report/ReportActionsList.tsx
@@ -277,7 +277,7 @@ function ReportActionsList({
             };
 
             // If no unread marker exists, don't set an unread marker for newly added messages from the current user.
-            const isFromCurrentUser = accountID === (isReportPreviewAction(message) ? message.childLastActorAccountID : message.actorAccountID);
+            const isFromCurrentUser = accountID === (isReportPreviewAction(message) && message.childLastActorAccountID !==0 ? message.childLastActorAccountID : message.actorAccountID);
             const isNewMessage = !prevSortedVisibleReportActionsObjects[message.reportActionID];
 
             // The unread marker will show if the action's `created` time is later than `unreadMarkerTime`.

From 9b342b38706e9e8fc5cb7dfbda740c5f7cd9573e Mon Sep 17 00:00:00 2001
From: Rohit Verma <rv17837@outlook.com>
Date: Fri, 21 Mar 2025 18:17:21 +0530
Subject: [PATCH 2/6] refactor by prettier

---
 src/pages/home/report/ReportActionsList.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx
index ad85009a5909..1c0229a64f56 100644
--- a/src/pages/home/report/ReportActionsList.tsx
+++ b/src/pages/home/report/ReportActionsList.tsx
@@ -277,7 +277,7 @@ function ReportActionsList({
             };
 
             // If no unread marker exists, don't set an unread marker for newly added messages from the current user.
-            const isFromCurrentUser = accountID === (isReportPreviewAction(message) && message.childLastActorAccountID !==0 ? message.childLastActorAccountID : message.actorAccountID);
+            const isFromCurrentUser = accountID === (isReportPreviewAction(message) && message.childLastActorAccountID !== 0 ? message.childLastActorAccountID : message.actorAccountID);
             const isNewMessage = !prevSortedVisibleReportActionsObjects[message.reportActionID];
 
             // The unread marker will show if the action's `created` time is later than `unreadMarkerTime`.

From 12b50c87bdcc9ff093987ae9ddf2eea21d70649f Mon Sep 17 00:00:00 2001
From: Rohit Verma <101377978+rohit9625@users.noreply.github.com>
Date: Sat, 22 Mar 2025 01:48:15 +0530
Subject: [PATCH 3/6] refactor: add check for null value of
 childLastActorAccountI

It ensures that childLastActorAccountID is both defined and truthy before using it.

Co-authored-by: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com>
---
 src/pages/home/report/ReportActionsList.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx
index 1c0229a64f56..c788f1238dce 100644
--- a/src/pages/home/report/ReportActionsList.tsx
+++ b/src/pages/home/report/ReportActionsList.tsx
@@ -277,7 +277,7 @@ function ReportActionsList({
             };
 
             // If no unread marker exists, don't set an unread marker for newly added messages from the current user.
-            const isFromCurrentUser = accountID === (isReportPreviewAction(message) && message.childLastActorAccountID !== 0 ? message.childLastActorAccountID : message.actorAccountID);
+            const isFromCurrentUser = accountID === (isReportPreviewAction(message) && !!message.childLastActorAccountID ? message.childLastActorAccountID : message.actorAccountID);
             const isNewMessage = !prevSortedVisibleReportActionsObjects[message.reportActionID];
 
             // The unread marker will show if the action's `created` time is later than `unreadMarkerTime`.

From 5568994d69095f8322e0f351e154f1d5cbf3fd5c Mon Sep 17 00:00:00 2001
From: Rohit Verma <rv17837@outlook.com>
Date: Sat, 22 Mar 2025 18:31:24 +0530
Subject: [PATCH 4/6] fix: read the newest reportAction as it is created

---
 src/pages/home/report/ReportActionsList.tsx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx
index c788f1238dce..6fa448b90323 100644
--- a/src/pages/home/report/ReportActionsList.tsx
+++ b/src/pages/home/report/ReportActionsList.tsx
@@ -349,6 +349,7 @@ function ReportActionsList({
         }
 
         setUnreadMarkerTime(mostRecentReportActionCreated);
+        readNewestAction(report.reportID);
 
         // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
     }, [lastAction?.created]);

From 4cedb6aaca07a5b2e4b62699266f91814f3910a9 Mon Sep 17 00:00:00 2001
From: Rohit Verma <rv17837@outlook.com>
Date: Sun, 30 Mar 2025 10:07:09 +0530
Subject: [PATCH 5/6] Revert "fix: read the newest reportAction as it is
 created"

This reverts commit 5568994d69095f8322e0f351e154f1d5cbf3fd5c.
---
 src/pages/home/report/ReportActionsList.tsx | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx
index 6fa448b90323..c788f1238dce 100644
--- a/src/pages/home/report/ReportActionsList.tsx
+++ b/src/pages/home/report/ReportActionsList.tsx
@@ -349,7 +349,6 @@ function ReportActionsList({
         }
 
         setUnreadMarkerTime(mostRecentReportActionCreated);
-        readNewestAction(report.reportID);
 
         // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
     }, [lastAction?.created]);

From c577d321c99088bbd7d5e728b279839c05252720 Mon Sep 17 00:00:00 2001
From: Rohit Verma <rv17837@outlook.com>
Date: Tue, 1 Apr 2025 20:32:29 +0530
Subject: [PATCH 6/6] fix: pass childLastActorAccountID prop to the successData

---
 src/libs/actions/IOU.ts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts
index 59cd5c5fdc81..11d00ef85bb8 100644
--- a/src/libs/actions/IOU.ts
+++ b/src/libs/actions/IOU.ts
@@ -7735,6 +7735,7 @@ function getSendMoneyParams(
             value: {
                 [reportPreviewAction.reportActionID]: {
                     pendingAction: null,
+                    childLastActorAccountID: reportPreviewAction.childLastActorAccountID,
                 },
             },
         },
