Skip to content

[Due for payment 2026-08-18] [$250] Onboarding - The tasks in Concierge chat not get auto-checked after completed #90550

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.3.73-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-28527/folder/13176677/41237673/1410973140
Email or phone of affected tester (no customers): lekima20+674405@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Win 11/Chrome
App Component: Other

Action Performed:

Precondition: Create a new account (with Manage my team, 11 to 50 employees) and complete onboarding flow

  1. Open https://staging.new.expensify.com
  2. Click on Concierge chat
  3. Click on the task "Take a test drive"
  4. Click on "Get started"
  5. Select other tasks and complete
  6. Refresh page

Expected Result:

The tasks should get auto-checked

Actual Result:

The tasks not get auto-checked

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7152962_1778680004673.Recording__2074.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022054619697415732813
  • Upwork Job ID: 2054619697415732813
  • Last Price Increase: 2026-06-04
Issue OwnerCurrent Issue Owner: @dominictb

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 13, 2026
  2. MelvinBot commented on May 13, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When onboarding tasks are auto-completed during setup, prepareOnboardingOnyxData updates the task report's stateNum/statusNum to APPROVED (ReportUtils.ts:11967-11975), but does not update the parent report action's childStateNum/childStatusNum that was pushed to the target chat at line 11924. Those fields are initialized to OPEN during creation at ReportUtils.ts:6482-6483 and never changed for auto-completed tasks.

    After a page refresh, TaskPreview.tsx:113-115 falls back to action.childStateNum/action.childStatusNum when the task sub-report isn't yet loaded into Onyx — and since those are still OPEN, the tasks appear unchecked.

    Compare this with the runtime completion path in Task.ts:464-486, which correctly updates both the task report and the parent report action's childStateNum/childStatusNum.

    What changes do you think we should make in order to solve the problem?

    In prepareOnboardingOnyxData inside ReportUtils.ts, when completedTaskReportAction exists, add an additional optimistic update that merges childStateNum: APPROVED and childStatusNum: APPROVED onto the parent report action in the target chat — mirroring the pattern used in buildTaskData at Task.ts:464-474.

    Concretely, inside the if (completedTaskReportAction) block, push an additional entry:

    {
        onyxMethod: Onyx.METHOD.MERGE,
        key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
        value: {
            [taskReportAction.reportAction.reportActionID]: {
                childStateNum: CONST.REPORT.STATE_NUM.APPROVED,
                childStatusNum: CONST.REPORT.STATUS_NUM.APPROVED,
            },
        },
    }
    

    This ensures TaskPreview's fallback path sees APPROVED immediately, regardless of whether the task sub-report has loaded.

    Related issues

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 13, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 13, 2026
  5. melvin-bot commented on May 13, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (External)

  6. MobileMage commented on May 13, 2026

    @MobileMage
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a new user completes onboarding tasks such as "Take a test drive" and other tasks listed in the Concierge chat (like inviting team members or submitting an expense), the task checkboxes in the Concierge chat do not auto-check to reflect the completed state after the user performs the corresponding action, even after refreshing the page.

    What is the root cause of that problem?

    The root cause is in completeTestDriveTask in src/libs/actions/Task.ts. This function calls getFinishOnboardingTaskOnyxData(...) but discards the return value entirely. The getFinishOnboardingTaskOnyxData function internally calls completeTask, which calls API.write(WRITE_COMMANDS.COMPLETE_TASK, parameters, {optimisticData, successData, failureData}) — passing the Onyx update arrays directly to the API layer so they get applied. This means the API write does fire and the server does receive the completion request. However, the issue is that this call path is intentional for some callers but there is a deeper problem: the getFinishOnboardingTaskOnyxData function was designed as a data-builder that also has the side effect of calling completeTask when conditions are met, but completeTestDriveTask calls it while ignoring the returned Onyx data, making the two roles of the function inconsistent and fragile.

    More critically: looking at the issue reproduction steps — the user clicks "Get started" on the "Take a test drive" task, which navigates to TestDriveDemo. The TestDriveDemo component has a useEffect that fires completeTestDriveTask only if hasSeenTour is false and viewTourTaskReport exists and is not already in STATE_NUM.APPROVED. The hasSeenTour value comes from NVP_ONBOARDING.selfTourViewed via hasSeenTourSelector. When the user navigates into the demo modal, the setSelfTourViewed() call inside completeTestDriveTask sets selfTourViewed = true in Onyx — which immediately causes hasSeenTour to flip to true on the next render, potentially preventing the completeTask API write from firing on re-renders. But the deeper problem is that even when it does fire, after a page refresh the task state depends entirely on what the server returns via NVP_INTRO_SELECTED and the corresponding report state, which will only be correct if the COMPLETE_TASK write succeeded and the server persisted it.

    The actual bug for the "other tasks" described in the issue (completing tasks from the test drive flow like submitting an expense) is in useExpenseSubmission.ts — completeTestDriveTask is called there too. The viewTourTaskReport in that context may be undefined if the user hasn't opened the test drive demo directly (they clicked "Get started" → selected other tasks → completed them outside the demo modal). In that case getFinishOnboardingTaskOnyxData receives a null task report, the if (taskReport && ...) guard fails, it returns {}, and no completeTask API call is ever made. The task remains unchecked both locally and after refresh.

    App/src/libs/actions/Task.ts

    Lines 1474 to 1494 in 7899e6b

    function completeTestDriveTask(
    viewTourTaskReport: OnyxEntry<OnyxTypes.Report>,
    viewTourTaskParentReport: OnyxEntry<OnyxTypes.Report>,
    isViewTourTaskParentReportArchived: boolean,
    currentUserAccountID: number,
    hasOutstandingChildTask: boolean,
    parentReportAction: OnyxEntry<ReportAction> | undefined,
    delegateEmail: string | undefined,
    shouldUpdateSelfTourViewedOnlyLocally = false,
    ) {
    setSelfTourViewed(shouldUpdateSelfTourViewedOnlyLocally);
    getFinishOnboardingTaskOnyxData(
    viewTourTaskReport,
    viewTourTaskParentReport,
    isViewTourTaskParentReportArchived,
    currentUserAccountID,
    hasOutstandingChildTask,
    parentReportAction,
    delegateEmail,
    );
    }

    What changes do you think we should make in order to solve the problem?

    The fix has two parts. First, in completeTestDriveTask in src/libs/actions/Task.ts, the call to getFinishOnboardingTaskOnyxData should be replaced with a direct call to completeTask that explicitly passes the task data, and the guard logic should be kept at the call sites. This makes the intent explicit and avoids the "builds data AND fires API" dual-purpose confusion. However, the more important fix is ensuring that the viewTourTaskReport is available at the time the completion is attempted. The hook useOnboardingTaskInformation(CONST.ONBOARDING_TASK_TYPE.VIEW_TOUR) reads from NVP_INTRO_SELECTED?.[VIEW_TOUR] to get the task report ID — if introSelected hasn't loaded yet when the action fires, viewTourTaskReport will be undefined and the completion is silently skipped.

    The correct fix is to make completeTestDriveTask more defensive: it should defer the task completion until viewTourTaskReport is confirmed available, or alternatively it should be called with an explicit guard at all call sites checking that viewTourTaskReport is non-null before invoking. Additionally, getFinishOnboardingTaskOnyxData should be renamed or split so it is purely a data builder (not calling completeTask itself), and all callers should pass the result's Onyx data to their own API.write call. This is the pattern already used in Category.ts and Tag.ts (which merge the returned data into their own request's onyxData), but the VIEW_TOUR task completes via a standalone call rather than piggy-backing on another write, so it needs its own API.write invocation using the returned data.

    Concretely: in completeTestDriveTask, after calling setSelfTourViewed, call completeTask(viewTourTaskReport, ...) directly (guarded by the same canActionTask check) rather than routing through getFinishOnboardingTaskOnyxData. This ensures the function always fires the API.write when the task report is present and actionable, rather than delegating through a helper that was designed for a different calling pattern.

    App/src/libs/actions/Task.ts

    Lines 1455 to 1473 in 7899e6b

    function getFinishOnboardingTaskOnyxData(
    taskReport: OnyxEntry<OnyxTypes.Report>,
    taskParentReport: OnyxEntry<OnyxTypes.Report>,
    isParentReportArchived: boolean,
    currentUserAccountID: number,
    hasOutstandingChildTask: boolean,
    parentReportAction: OnyxEntry<ReportAction> | undefined,
    delegateEmail: string | undefined,
    ): OnyxData<typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS> {
    if (taskReport && canActionTask(taskReport, parentReportAction, currentUserAccountID, taskParentReport, isParentReportArchived)) {
    if (taskReport) {
    if (taskReport.stateNum !== CONST.REPORT.STATE_NUM.APPROVED || taskReport.statusNum !== CONST.REPORT.STATUS_NUM.APPROVED) {
    return completeTask(taskReport, taskParentReport?.hasOutstandingChildTask ?? false, hasOutstandingChildTask, parentReportAction, delegateEmail, undefined, false);
    }
    }
    }
    return {};
    }

    What alternative solutions did you explore? (Optional)

    N/A

  7. changed the title [-]Onboarding - The tasks in Concierge chat not get auto-checked after completed[/-] [+][$250] Onboarding - The tasks in Concierge chat not get auto-checked after completed[/+] on May 13, 2026
  8. melvin-bot commented on May 13, 2026

    @melvin-bot
  9. aswin-s commented on May 13, 2026

    @aswin-s
    Contributor

    Please re-state the problem that we are trying to solve in this issue.

    When a new account completes the onboarding flow with "Manage my team" (11-50 employees) and performs onboarding tasks that auto-complete (e.g., viewing the test drive or completing marked tasks), the tasks appear unchecked in the Concierge chat after a page refresh. Users expect the tasks to display as checked since they have been completed.

    What is the root cause of that problem?

    The bug originates in prepareOnboardingOnyxData at src/libs/ReportUtils.ts:11920-11931. When auto-completed onboarding tasks are processed, the function updates the task sub-report's stateNum and statusNum to APPROVED, but it fails to update the parent chat's report action (taskReportAction) which carries the childStateNum and childStatusNum fields. These parent-action fields are seeded to OPEN by buildOptimisticTaskCommentReportAction. After a page refresh, TaskPreview (src/components/ReportActionItem/TaskPreview.tsx) reads the task report from Onyx; if it hasn't loaded yet, it falls back to action.childStateNum/childStatusNum which remain OPEN, causing the task to render unchecked. The working pattern exists in buildTaskData at src/libs/actions/Task.ts:453-463 which correctly updates both the sub-report state and the parent-action's childStateNum/childStatusNum.

    App/src/libs/ReportUtils.ts

    Lines 11920 to 11931 in 7ef6d9e

    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
    value: {
    [taskReportAction.reportAction.reportActionID]: taskReportAction.reportAction as ReportAction,
    },
    },
    {
    onyxMethod: Onyx.METHOD.SET,
    key: `${ONYXKEYS.COLLECTION.REPORT}${currentTask.reportID}`,
    value: {
    ...currentTask,

    value: {
    [completedTaskReportAction.reportActionID]: {
    errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('task.messages.error'),
    },
    },
    },
    ];
    const parentReportID = taskReport?.parentReportID;
    const parentReportActionID = parentReportAction?.reportActionID ?? taskReport?.parentReportActionID;

    Because childStateNum and childStatusNum on the parent report action are the sole source of truth for TaskPreview until the task sub-report finishes loading from Onyx, any cold-start, page refresh, or re-login scenario will render tasks as unchecked even though they were already approved. This is purely a client-side Onyx data inconsistency — the same Onyx merge path is used on all platforms (Web, iOS, Android, mWeb), so the bug manifests identically across clients. No platform-specific branching is needed; fixing the shared prepareOnboardingOnyxData path resolves the issue everywhere.

    What changes do you think we should make in order to solve the problem?

    1. File: src/libs/ReportUtils.ts, Function: prepareOnboardingOnyxData

      Description: Inside the if (completedTaskReportAction) block (after the existing state update to the task sub-report), add a new Onyx merge operation to update the parent report action's childStateNum and childStatusNum to APPROVED. Guard the operation with a null check on completedTaskReportAction and its reportActionID before constructing the merge key. This mirrors the pattern in buildTaskData and ensures the task appears checked in the parent chat without requiring the task sub-report to load first.

      // Inside prepareOnboardingOnyxData, within the if (completedTaskReportAction) block,
      // after the existing task sub-report stateNum/statusNum update:
      
      if (completedTaskReportAction?.reportActionID) {
          tasksForOptimisticData.push({
              onyxMethod: Onyx.METHOD.MERGE,
              key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReport.chatReportID}`,
              value: {
                  [completedTaskReportAction.reportActionID]: {
                      childStateNum: CONST.REPORT.STATE_NUM.APPROVED,
                      childStatusNum: CONST.REPORT.STATUS_NUM.APPROVED,
                  },
              },
          });
      }

      The null guard (completedTaskReportAction?.reportActionID) ensures this block is a no-op if the action has not yet been hydrated — for example during an Onyx rehydration race on app cold start or re-login. In those cases the task sub-report will eventually load and TaskPreview will switch to reading stateNum directly, so skipping the parent-action update is safe.

    2. File: src/libs/ReportUtils.ts, Function: prepareOnboardingOnyxData

      Description: Inside the tasksForFailureData reducer block (when a task update fails), add a corresponding failure data entry that resets the parent report action's childStateNum and childStatusNum back to OPEN. Apply the same null guard so the failure entry is only pushed when completedTaskReportAction.reportActionID is available, preventing a stale or partial key from being written during hydration races.

      // Inside the tasksForFailureData reducer, alongside the existing task sub-report reset:
      
      if (completedTaskReportAction?.reportActionID) {
          acc.push({
              onyxMethod: Onyx.METHOD.MERGE,
              key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReport.chatReportID}`,
              value: {
                  [completedTaskReportAction.reportActionID]: {
                      childStateNum: CONST.REPORT.STATE_NUM.OPEN,
                      childStatusNum: CONST.REPORT.STATUS_NUM.OPEN,
                  },
              },
          });
      }

      This keeps optimistic and failure data symmetric. If the server rejects the task completion, both the sub-report state and the parent-action childStateNum/childStatusNum roll back to OPEN together, preventing a scenario where the task renders as checked despite the server rejecting it.

    Blast radius: Changes are scoped to the onboarding task setup flow in prepareOnboardingOnyxData and its related Onyx optimistic/failure data. No other callers of this function are affected. The update mirrors the existing pattern in buildTaskData (Task.ts). Because the fix writes to the shared REPORT_ACTIONS Onyx collection using the standard merge method, it takes effect on all platforms (Web, iOS, Android, mWeb) without any client-specific branching.

    What alternative solutions did you explore? (Optional)

    N/A

  10. oqildev commented on May 13, 2026

    @oqildev
    Contributor

    Proposal

    What is the root cause of that problem?

    I traced the repro on a brand-new MANAGE_TEAM account, and the symptom isn't one bug — it's three independent gaps that all sit on the same code path, and which one you hit depends on which "other task" you complete in step 5. That's why the existing proposals each fix a subset and the C+ reviewer can still reproduce.

    Everything funnels through useOnboardingTaskInformation(taskName), which resolves the task sub-report exclusively through introSelected?.[taskName]:

    https://github.com/Expensify/App/blob/main/src/hooks/useOnboardingTaskInformation.ts#L8-L23

    So any task whose report ID is missing from NVP_INTRO_SELECTED is invisible to its completion flow.

    Gap 1 — viewTour and setupCategories task report IDs are never written into NVP_INTRO_SELECTED (this is what fails in step 3–5 of the repro).

    prepareOnboardingOnyxData only captures four IDs: createWorkspace, addExpenseApprovals, setupTags, setupCategoriesAndTags:

    https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L11828-L11831

    https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L11911-L11922

    https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L12124-L12134

    viewTour and setupCategories are absent from the tracking variables and from the optimistic NVP_INTRO_SELECTED merge, even though IntroSelected already declares both fields (src/types/onyx/IntroSelected.ts:18-28).

    Downstream consequences I confirmed:

    • TestDriveDemo calls useOnboardingTaskInformation(VIEW_TOUR). When introSelected.viewTour is undefined, viewTourTaskReport is undefined, and the effect falls into the !viewTourTaskReport fallback at TestDriveDemo.tsx:59-65 (added in fix: Onboarding - Take a test drive doesn't dismiss for Expensifail account #89484 for Test-Drive-Receiver accounts). That fallback fires only openReport(conciergeReportID) and returns. On the next render setSelfTourViewed has already flipped hasSeenTour to true, the if (hasSeenTour) return; at line 56 short-circuits, and completeTestDriveTask — the only call site that fires COMPLETE_TASK for the test-drive task — never runs.
    • CreateCategoryPage calls useOnboardingTaskInformation(SETUP_CATEGORIES) and threads the result into createPolicyCategory → appendSetupCategoriesOnboardingData. Without introSelected.setupCategories, the taskReport is undefined, the if (taskReport && canActionTask(...)) guard in getFinishOnboardingTaskOnyxData fails, and completeTask is never called: Task.ts:1448-1456.

    The runtime completion path through buildTaskData already writes the parent action's childStateNum/childStatusNum correctly (Task.ts:454-476). Once the IDs land in NVP_INTRO_SELECTED, the runtime path takes over and the rest is already correct — yusufdeveloper2903's rebuttal is right on that point. This pattern was already applied for setupTags/setupCategoriesAndTags in PR #87166; viewTour and setupCategories were simply omitted.

    Gap 2 — auto-completed tasks (autoCompleted: true, e.g. createWorkspaceTask; plus the runtime auto-completion at ReportUtils.ts:11898-11905 for VIEW_TOUR when selfTourViewed and INVITE_ACCOUNTANT when isInvitedAccountant) update only the task sub-report's stateNum/statusNum, never the parent chat's childStateNum/childStatusNum.

    https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L12010-L12028

    The parent task-preview action is built with childStateNum/childStatusNum = OPEN (ReportUtils.ts:6482-6483). After refresh, TaskPreview falls back to the parent action's child state while the sub-report is rehydrating:

    https://github.com/Expensify/App/blob/main/src/components/ReportActionItem/TaskPreview.tsx#L112-L114

    The runtime path in buildTaskData mirrors both halves under a single if (parentReportID && parentReportActionID) guard (Task.ts:454-476); the onboarding path does not.

    Gap 3 — INVITE_TEAM and CONNECT_CORPORATE_CARD have no client-side completion wiring at all.

    These two tasks exist in the MANAGE_TEAM checklist (OnboardingFlow.ts:252-264, 321-334), but IntroSelectedTask doesn't even declare them (IntroSelected.ts:5), and neither addMembersToWorkspace (Member.ts:950-990) nor addNewCompanyCardsFeed (CompanyCards.ts:176-254) appends getFinishOnboardingTaskOnyxData to its Onyx update. The user can invite a teammate or connect a card and the corresponding task never receives a COMPLETE_TASK write. This is the gap KJ21-ENG correctly identified.

    What changes do you think we should make in order to solve the problem?

    The fix sits at the data-construction layer (prepareOnboardingOnyxData) for Gaps 1 & 2, and at the action layer for Gap 3. I'd land all three together — the C+ tested the existing proposals and reproduced because each one fixes only a slice.

    Gap 1 — extend prepareOnboardingOnyxData:

    Edge case worth calling out: there is a filter at ReportUtils.ts:11849-11862 that excludes VIEW_TOUR for some introSelected.choice values combined with engagementChoice === MANAGE_TEAM. For a brand-new MANAGE_TEAM signup the filter does not trigger (no prior introSelected.choice); the task does get created, so we do want its ID captured. No change needed to the filter.

    Gap 2 — mirror auto-completion onto the parent task-preview action. Inside the existing if (completedTaskReportAction) block at ReportUtils.ts:12010-12028, push one more optimistic MERGE on ${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID} setting [taskReportAction.reportAction.reportActionID].childStateNum = APPROVED and .childStatusNum = APPROVED. Symmetric rollback in tasksForFailureData at ReportUtils.ts:12033-12057: when completedTaskReportAction exists for that row, also merge childStateNum: OPEN, childStatusNum: OPEN next to the existing errors write — this matters because the same failure block nulls the sub-report at lines 12045-12053, which would otherwise route TaskPreview straight to a stale APPROVED parent-action fallback.

    I'd reject emkhalid's approach of widening buildOptimisticTaskCommentReportAction's signature: the helper is also called from optimisticAssigneeAddComment at ReportUtils.ts:10580 where the OPEN default is still correct, and a dedicated paired optimistic/failure MERGE matches the convention used by buildTaskData and reopenTask.

    Gap 3 — wire INVITE_TEAM and CONNECT_CORPORATE_CARD through the shared completion contract.

    • Add inviteTeam and connectCorporateCard to IntroSelectedTask and the IntroSelected type at IntroSelected.ts:4-37; track and emit their IDs in prepareOnboardingOnyxData the same way as Gap 1.
    • In WorkspaceInviteMessageComponent.sendInvitation (WorkspaceInviteMessageComponent.tsx:148-163) read useOnboardingTaskInformation(INVITE_TEAM) and thread the task report through addMembersToWorkspace. Inside addMembersToWorkspace (Member.ts:950-990) append the getFinishOnboardingTaskOnyxData(...) arrays into the existing ADD_MEMBERS_TO_WORKSPACE optimisticData/successData/failureData — same pattern appendSetupCategoriesOnboardingData uses at Category.ts:79-104.
    • Mirror that for addNewCompanyCardsFeed and importCSVCompanyCards in CompanyCards.ts and the call sites in DetailsStep.tsx / CompanyCardsImportedPage.tsx.

    Edge cases: offline rollback is covered because we piggyback on the host write's failureData. The canActionTask guard inside getFinishOnboardingTaskOnyxData already prevents double-completion if the task is already APPROVED (Task.ts:1448-1456) — important because re-invoking addMembersToWorkspace for a second invite shouldn't re-fire COMPLETE_TASK.

    What alternative solutions did you explore?

    • Fix only the childStateNum parent-action mismatch (Group 1 proposals — aswin-s / trasnake87 / emkhalid / MelvinBot). Rejected for this repro: the affected tasks (VIEW_TOUR, SETUP_CATEGORIES, INVITE_TEAM, CONNECT_CORPORATE_CARD for a brand-new MANAGE_TEAM account) are not in the if (completedTaskReportAction) auto-completion branch — they complete at runtime, where buildTaskData already handles the parent action correctly. So Group 1 alone leaves the repro broken. It's still a real bug for createWorkspaceTask / INVITE_ACCOUNTANT / selfTourViewed-precondition cases, which is why Gap 2 is included.

    • Refactor completeTestDriveTask to stop ignoring getFinishOnboardingTaskOnyxData's return value (MobileMage). Rejected: that helper already invokes completeTask internally as a side effect — the call still issues API.write(COMPLETE_TASK, …) (Task.ts:527). The discarded return is cosmetic; the real reason no API write fires is that taskReport is undefined (Gap 1).

    • Make useOnboardingTaskInformation look the task up by scanning allReports for type === TASK matching the onboarding task type instead of going through NVP_INTRO_SELECTED. Rejected: onboarding task reports don't carry a stable task-type tag on the report itself (only the title/description hint at it), and a full allReports scan on every render is far more expensive than reading one NVP key.

    • Have TestDriveDemo resolve the task report via the parent action of the Concierge entry the user just tapped, rather than via NVP_INTRO_SELECTED. Rejected: it patches VIEW_TOUR only and leaves SETUP_CATEGORIES, INVITE_TEAM, and CONNECT_CORPORATE_CARD broken, plus any future onboarding task added without remembering to thread its ID through introSelected. Fixing the data-construction site prevents the same regression class.

  11. aswin-s commented on May 13, 2026

    @aswin-s
    Contributor

    Updated the proposal above to tighten 4 edge cases (additional guards and broader coverage).

  12. trasnake87 commented on May 13, 2026

    @trasnake87
    Contributor

    Proposal

    Onboarding tasks that are auto-completed during account creation (e.g. createWorkspaceTask when autoCompleted: true, VIEW_TOUR when the self-tour has already been viewed, INVITE_ACCOUNTANT when the accountant is already invited, and startChat for invite-based onboarding) render as unchecked after a hard refresh, because the optimistic Onyx write only flips the task sub-report's stateNum/statusNum and never updates the parent chat action's childStateNum/childStatusNum.

    Root cause

    buildOptimisticTaskCommentReportAction always seeds the parent chat action with childStateNum = OPEN and childStatusNum = OPEN, regardless of whether the task will subsequently be marked complete:

    // src/libs/ReportUtils.ts:6550-6556
    reportAction.reportAction.childReportID = taskReportID;
    reportAction.reportAction.parentReportID = parentReportID;
    reportAction.reportAction.childType = CONST.REPORT.TYPE.TASK;
    reportAction.reportAction.childReportName = taskTitle;
    reportAction.reportAction.childManagerAccountID = taskAssigneeAccountID;
    reportAction.reportAction.childStatusNum = CONST.REPORT.STATUS_NUM.OPEN;
    reportAction.reportAction.childStateNum = CONST.REPORT.STATE_NUM.OPEN;

    prepareOnboardingOnyxData then builds optimistic data for an auto-completed task by (a) appending the TASK_COMPLETED report action onto the task's own report actions, and (b) merging stateNum/statusNum: APPROVED onto the task sub-report — but it never updates the parent task report action that lives on the target chat (targetChatReportID):

    // src/libs/ReportUtils.ts:11993-12011 — current optimistic block for auto-completed tasks
    if (completedTaskReportAction) {
        acc.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${currentTask.reportID}`,
            value: {
                [completedTaskReportAction.reportActionID]: completedTaskReportAction as ReportAction,
            },
        });
    
        acc.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT}${currentTask.reportID}`,
            value: {
                stateNum: CONST.REPORT.STATE_NUM.APPROVED,
                statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
                managerID: deprecatedCurrentUserAccountID,
            },
        });
    }

    TaskPreview then has a documented fallback: when the task sub-report isn't yet in Onyx, it derives the checked state from the parent action's childStateNum/childStatusNum:

    // src/components/ReportActionItem/TaskPreview.tsx:110-115
    // The reportAction might not contain details regarding the taskReport
    // Only the direct parent reportAction will contain details about the taskReport
    // Other linked reportActions will only contain the taskReportID and we will grab the details from there
    const isTaskCompleted = !isEmptyObject(taskReport)
        ? taskReport?.stateNum === CONST.REPORT.STATE_NUM.APPROVED && taskReport.statusNum === CONST.REPORT.STATUS_NUM.APPROVED
        : action?.childStateNum === CONST.REPORT.STATE_NUM.APPROVED && action?.childStatusNum === CONST.REPORT.STATUS_NUM.APPROVED;

    After a refresh, the Concierge chat and its report actions hydrate from OpenReport before the individual task sub-reports are pulled in, so taskReport is undefined for a render tick or more. The fallback reads the stale childStateNum: OPEN baked in at task-creation time, and the checkbox renders empty. The same stale value also leaks into useHasOutstandingChildTask (src/hooks/useHasOutstandingChildTask.ts:22-37), which scans parent-chat report actions for childStateNum === OPEN, so the parent chat's "outstanding child task" badge can also misreport.

    The runtime task-completion path does not have this bug — buildTaskData writes both halves under the same if (parentReportID && parentReportActionID) guard:

    // src/libs/actions/Task.ts:454-476 — runtime completion correctly mirrors child state
    if (parentReportID && parentReportActionID) {
        optimisticData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`,
            value: {
                [parentReportActionID]: {
                    childStateNum: CONST.REPORT.STATE_NUM.APPROVED,
                    childStatusNum: CONST.REPORT.STATUS_NUM.APPROVED,
                },
            },
        });
    
        failureData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`,
            value: {
                [parentReportActionID]: {
                    childStateNum: CONST.REPORT.STATE_NUM.OPEN,
                    childStatusNum: CONST.REPORT.STATUS_NUM.OPEN,
                },
            },
        });
    }

    The onboarding path must do the same — both in optimisticData so the fallback path renders correctly, and in failureData so a server-side rejection rolls the parent action back to OPEN (otherwise the chat action keeps showing the task as complete even though the failure path nulls out the task sub-report at src/libs/ReportUtils.ts:12028-12036, which would route TaskPreview straight to the now-incorrect childStateNum: APPROVED fallback).

    Proposed fix

    Update both the optimistic and failure builders in prepareOnboardingOnyxData to mirror the parent action's child state to whatever the task sub-report's state is.

    // src/libs/ReportUtils.ts:11993-12011 — extend the auto-completion optimistic block
    if (completedTaskReportAction) {
        acc.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${currentTask.reportID}`,
            value: {
                [completedTaskReportAction.reportActionID]: completedTaskReportAction as ReportAction,
            },
        });
    
        acc.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT}${currentTask.reportID}`,
            value: {
                stateNum: CONST.REPORT.STATE_NUM.APPROVED,
                statusNum: CONST.REPORT.STATUS_NUM.APPROVED,
                managerID: deprecatedCurrentUserAccountID,
            },
        });
    
        // Mirror the completion onto the parent chat's task-preview report action so
        // TaskPreview's fallback (action.childStateNum/childStatusNum) renders the
        // checkbox as checked when the task sub-report isn't hydrated yet (e.g. after refresh).
        acc.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
            value: {
                [taskReportAction.reportAction.reportActionID]: {
                    childStateNum: CONST.REPORT.STATE_NUM.APPROVED,
                    childStatusNum: CONST.REPORT.STATUS_NUM.APPROVED,
                },
            },
        });
    }

    Add a symmetric rollback to tasksForFailureData (src/libs/ReportUtils.ts:12016-12040) so a failed onboarding write resets the parent action's child state, otherwise the task sub-report is nulled while the parent action still reports APPROVED:

    // src/libs/ReportUtils.ts:12016-12040 — add to the failure reducer
    const tasksForFailureData = tasksData.reduce<...>((acc, {currentTask, taskReportAction, completedTaskReportAction}) => {
        acc.push(
            {
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
                value: {
                    [taskReportAction.reportAction.reportActionID]: {
                        errors: getMicroSecondOnyxErrorWithTranslationKey('report.genericAddCommentFailureMessage'),
                        ...(completedTaskReportAction && {
                            childStateNum: CONST.REPORT.STATE_NUM.OPEN,
                            childStatusNum: CONST.REPORT.STATUS_NUM.OPEN,
                        }),
                    } as ReportAction,
                },
            },
            // ...existing report + report-actions nulls
        );
    
        return acc;
    }, []);

    Why this approach

    Mirroring child state onto the parent action follows the exact pattern already used in two runtime task flows — buildTaskData (src/libs/actions/Task.ts:454-476) for completion and reopenTask (src/libs/actions/Task.ts:582-593) for reopening — both of which guard on parentReportID && parentReportActionID and push paired optimistic/failure merges. Keeping the fix inside the existing if (completedTaskReportAction) branch avoids touching the buildOptimisticTaskCommentReportAction signature (which is also called from optimisticAssigneeAddComment at src/libs/ReportUtils.ts:10580 where the OPEN default is still correct).

    An alternative — mutating taskReportAction.reportAction.childStateNum/childStatusNum directly after computing isTaskAutoCompleted so the first optimistic write at src/libs/ReportUtils.ts:11957-11960 already carries the right values — was rejected because the same taskReportAction object is referenced by tasksForParameters (src/libs/ReportUtils.ts:11929-11939) and tasksForFailureData, making the mutation harder to reason about and harder to roll back symmetrically. A dedicated MERGE push keeps the optimistic and failure paths explicit and symmetric, which is the convention the rest of the file already follows.

  13. 113 remaining items

  14. dominictb commented on Aug 15, 2026

    @dominictb
    Contributor

    @KJ21-ENG I can't reproduce the issue following your steps here #90550 (comment). Can you try?

    Screen.Recording.2026-08-15.at.23.32.56.mov
  15. KJ21-ENG commented on Aug 15, 2026

    @KJ21-ENG
    Contributor

    @dominictb Now it’s not being reproduced on my side either.

    cc: @neil-marcellini @cretadn22

  16. cretadn22 commented on Aug 18, 2026

    @cretadn22
    Contributor

    Same here. I'm no longer able to reproduce this either. Let's go ahead and close this issue.

  17. cretadn22 commented on Aug 18, 2026

    @cretadn22
    Contributor

    @mallenexpensify for payment handling. We previously agreed with @KJ21-ENG's proposal and assigned the issue to them, but while waiting on the backend update, the issue was resolved elsewhere. No further work is required here

  18. changed the title [-][$250] Onboarding - The tasks in Concierge chat not get auto-checked after completed[/-] [+][Due for payment 2026-08-18] [$250] Onboarding - The tasks in Concierge chat not get auto-checked after completed[/+] on Aug 18, 2026
  19. melvin-bot commented on Aug 18, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  20. mallenexpensify commented on Aug 18, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @KJ21-ENG paid $125 via Upwork
    Contributor+: @cretadn22 due $125 via NewDot

    @KJ21-ENG can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022089787587667622403

    this is an edge case, it's rare we hire/assign a contributor where they don't raise a PR. paying $125 now, per our process, will likely lower the amount or % in the future.

  21. KJ21-ENG commented on Aug 18, 2026

    @KJ21-ENG
    Contributor

    @mallenexpensify Offer accepted, Thanks!

  22. mallenexpensify commented on Aug 19, 2026

    @mallenexpensify
    Contributor

    @KJ21-ENG paid, summary updated above. Thx.

  23. JmillsExpensify commented on Aug 24, 2026

    @JmillsExpensify
    Contributor

    $125 approved for @cretadn22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions