diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 64360b0b7e36..9b5e45bc8c3f 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5845,7 +5845,7 @@ function getChatByParticipants(newParticipantList: number[], reports: OnyxCollec const participantAccountIDs = Object.keys(report?.participants ?? {}); // Skip if it's not a 1:1 chat - if (!shouldIncludeGroupChats && !isOneOnOneChat(report)) { + if (!shouldIncludeGroupChats && !isOneOnOneChat(report) && !isSystemChat(report)) { return false; } diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 5f1baa25b3cf..ca489b923265 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3232,6 +3232,9 @@ function completeOnboarding( const isAccountIDOdd = AccountUtils.isAccountIDOddNumber(currentUserAccountID ?? 0); const targetEmail = isAccountIDOdd ? CONST.EMAIL.NOTIFICATIONS : CONST.EMAIL.CONCIERGE; + // If the target report isn't opened, the permission field will not exist. So we should add the fallback permission for task report + const fallbackPermission = isAccountIDOdd ? [CONST.REPORT.PERMISSIONS.READ] : [CONST.REPORT.PERMISSIONS.READ, CONST.REPORT.PERMISSIONS.WRITE]; + const actorAccountID = PersonalDetailsUtils.getAccountIDsByLogins([targetEmail])[0]; const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {}; @@ -3347,6 +3350,7 @@ function completeOnboarding( }, isOptimisticReport: true, managerID: currentUserAccountID, + permissions: targetChatReport?.permissions ?? fallbackPermission, }, }, {