fix: Task complete sound is heard after adding tag without Set up tag#81814
fix: Task complete sound is heard after adding tag without Set up tag#81814paulnjs wants to merge 21 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
|
||
| if (isTaskIncomplete(setupTagsTaskReport)) { | ||
| completeTask(setupTagsTaskReport, false, false, undefined); | ||
| // Complete the "Set up tags" onboarding task |
There was a problem hiding this comment.
❌ CONSISTENCY-6 (docs)
The return value of getFinishOnboardingTaskOnyxData is not being used. This function returns OnyxData that must be merged into the onyxData object passed to the API call, otherwise the onboarding task completion will not work correctly.
Looking at the correct implementation in src/libs/actions/Policy/Category.ts (lines 89-99):
const finishOnboardingTaskData = getFinishOnboardingTaskOnyxData(
setupCategoryTaskReport,
setupCategoryTaskParentReport,
isSetupCategoriesTaskParentReportArchived,
currentUserAccountID,
hasOutstandingChildTask,
parentReportAction,
);
onyxData.optimisticData?.push(...(finishOnboardingTaskData.optimisticData ?? []));
onyxData.successData?.push(...(finishOnboardingTaskData.successData ?? []));
onyxData.failureData?.push(...(finishOnboardingTaskData.failureData ?? []));The same pattern should be applied here for both task completions.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Can you resolve this comment?
src/libs/actions/Policy/Tag.ts
Outdated
| if (isTaskIncomplete(setupCategoriesAndTagsTaskReport) && policyHasCustomCategories) { | ||
| completeTask(setupCategoriesAndTagsTaskReport, false, false, undefined); | ||
| // Complete the combined "Set up categories and tags" task only if categories already exist | ||
| if (setupCategoriesAndTagsTaskReport && policyHasCustomCategories && currentUserAccountID) { |
There was a problem hiding this comment.
❌ CONSISTENCY-6 (docs)
Same issue here - the return value of getFinishOnboardingTaskOnyxData is not being used. The returned OnyxData must be merged into the onyxData object that was passed to API.write on line 211, otherwise the task completion state changes will not be persisted.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Code Review CompleteI've reviewed PR #81814 and found 2 critical issues that need to be addressed: Critical Issues❌ CONSISTENCY-6 Violation (Return Values Not Used) The code calls Location 1: Required FixThe function // Get the onboarding task Onyx data
const setupTagsOnyxData = getFinishOnboardingTaskOnyxData(
setupTagsTaskReport,
setupTagsTaskParentReport,
isSetupTagsTaskParentReportArchived ?? false,
currentUserAccountID,
setupTagsHasOutstandingChildTask ?? false,
setupTagsParentReportAction,
);
// Merge it into the existing onyxData structure
if (setupTagsOnyxData) {
onyxData.optimisticData.push(...(setupTagsOnyxData.optimisticData ?? []));
onyxData.successData.push(...(setupTagsOnyxData.successData ?? []));
onyxData.failureData.push(...(setupTagsOnyxData.failureData ?? []));
}Apply this pattern for both the Why This MattersWithout using the return value, the Onyx store won't be updated to mark the tasks as complete, so:
This review was performed by the code-inline-reviewer agent following Expensify's review guidelines. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Fine for product
|
@paulnjs please address bot reviews above |
|
And merge main |
|
@situchan With comment from bot, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46131ec035
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
tests/actions/PolicyTagTest.ts
Outdated
| isSetupCategoriesAndTagsTaskParentReportArchived: false, | ||
| setupCategoriesAndTagsHasOutstandingChildTask: false, | ||
| setupCategoriesAndTagsParentReportAction: undefined, | ||
| currentUserAccountID: 0, |
There was a problem hiding this comment.
Exercise onboarding completion path in new tag tests
The new createPolicyTag tests that claim to verify onboarding-task completion all pass currentUserAccountID: 0, but createPolicyTag now guards completion with if (setup*TaskReport && currentUserAccountID), so those test cases never execute getFinishOnboardingTaskOnyxData and cannot catch regressions in task completion behavior. Use a non-zero account ID (and assert task completion side effects) so these tests validate the path named in their descriptions.
Useful? React with 👍 / 👎.
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@paulnjs bump ^. And conflicts |
|
@situchan I updated. The test failed come from main |
| parentReportAction: setupCategoriesAndTagsParentReportAction, | ||
| } = useOnboardingTaskInformation(CONST.ONBOARDING_TASK_TYPE.SETUP_CATEGORIES_AND_TAGS); | ||
|
|
||
| const createTag = useCallback( |
|
|
||
| if (isTaskIncomplete(setupTagsTaskReport)) { | ||
| completeTask(setupTagsTaskReport, false, false, undefined); | ||
| const isTaskForCurrentWorkspace = (taskReport: OnyxEntry<Report>) => !taskReport?.policyID || taskReport.policyID === policyID; |
|
Actually I am not sure what the bug is in linked issue and what we're trying to fix. It seems this PR is just regressing the complete logic in concierge chat which works fine on production. I don't even see tasks generated in #admins channel for first created workspace without deletion. @paulnjs can you elaborate the bug what you fixed? |
|
@situchan As mentioned in the proposal, this issue is that the task completion is still triggered after adding a tag in any workspace, even though the onboarding workspace has already been deleted. To fix this, the PR ensures that before calling completeTask, we check whether the onboarding workspace still exists. If the onboarding workspace has been deleted, the task completion will not been triggered |
@paulnjs can you share video? |
|
You mean that concierge task should not be completed if triggered in non-onboarding workspace? |
No, I mean the concierge task shouldn't be completed if the onboarding workspace is deleted. |
You can also check the video in the OP. At the 23rd second, the sound is triggered to announce that the task is completed, but it shouldn’t be, since the onboarding workspace was already deleted. |
|
Did you test category case? The category task is also completed when onboarding workspace is deleted. |
|
@situchan Could you share a video? I tried creating a new category, but no task completion logic was triggered when onboarding workspace is deleted. |
Screen.Recording.2026-03-10.at.4.00.45.PM.mov |
|
@situchan In your video, the onboarding tasks are located in Concierge, not in the Admin room of the workspace. Because of that, if the workspace is deleted, the tasks can still be completed since they belong to Concierge rather than the workspace |
Do you have repro step of onboarding tasks being located in Admin room? |
|
@situchan You can create new account without "+" character |
|
Please merge main |
Code ReviewPR Status: All CI checks pass. The approach aligns with the approved proposal. SummaryThis PR fixes the bug where a "task complete" sound plays after adding a tag in a workspace that doesn't have the corresponding onboarding task, specifically when the original onboarding workspace was deleted. The fix replaces direct Previous Bot Review (Addressed)The earlier automated review flagged that What Looks Good
Minor Notes (Non-blocking)
VerdictThe approach is sound and follows the approved proposal. The |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@paulnjs remove this code: App/src/pages/workspace/tags/WorkspaceCreateTagPage.tsx Lines 37 to 40 in e3f9358 Then use const {
+ taskReport: setupTagsTaskReport,
taskParentReport: setupTagsTaskParentReport,
isOnboardingTaskParentReportArchived: isSetupTagsTaskParentReportArchived,
hasOutstandingChildTask: setupTagsHasOutstandingChildTask,
parentReportAction: setupTagsParentReportAction,
} = useOnboardingTaskInformation(CONST.ONBOARDING_TASK_TYPE.SETUP_TAGS);
const {
+ taskReport: setupCategoriesAndTagsTaskReport,
taskParentReport: setupCategoriesAndTagsTaskParentReport,
isOnboardingTaskParentReportArchived: isSetupCategoriesAndTagsTaskParentReportArchived,
hasOutstandingChildTask: setupCategoriesAndTagsHasOutstandingChildTask,
parentReportAction: setupCategoriesAndTagsParentReportAction,
} = useOnboardingTaskInformation(CONST.ONBOARDING_TASK_TYPE.SETUP_CATEGORIES_AND_TAGS); |
|
There's lint error |
|
The lint error is fixed |


Explanation of Change
Fixed Issues
$#80294
PROPOSAL:#80294 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android-mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-mweb.mp4
MacOS: Chrome / Safari
web.mp4