Skip to content

[$250] "Take a test drive" not displayed in suggestions #90861

Closed

Description

@jponikarchuk

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: 9.3.75-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #83138
Email or phone of affected tester (no customers): jsat@applausemail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Macbook Pro/iOS 13.7.8, iPhone 13/18.6.2, Samsung S21/Android 15
App Component: Other

Action Performed:

  1. Launch the app
  2. Login with a new Gmail account
  3. Tap the search icon
  4. Enter In: and select take a test drive from suggestions

Expected Result:

"in:take a test drive" is displayed in the suggestions list and can be selected

Actual Result:

"in:take a test drive" is not displayed in the suggestions list after typing "in"

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022055509075834961534
  • Upwork Job ID: 2055509075834961534
  • Last Price Increase: 2026-05-16
Issue OwnerCurrent Issue Owner: @marcaaron

Activity

  1. added
    Daily
    Bug
    on May 16, 2026
  2. MelvinBot commented on May 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #83138 (referenced in this issue) is not the cause — it only changed getQueryWithUpdatedValues which runs at search submission time, not during autocomplete suggestion population.

    After tracing the full in: autocomplete path (useAutocompleteSuggestions → getSearchOptions → getValidOptions → optionsOrderAndGroupBy), the filtering logic correctly handles task reports:

    The most likely root cause is that the "Take a test drive" task report does not exist in Onyx when the user opens search. This happens when:

    1. Followups-instead-of-tasks path: Users who select MANAGE_TEAM during onboarding with a micro company size (or with the suggestedFollowups beta) trigger shouldUseFollowupsInsteadOfTasks, which sets tasks = [] at L11778 — no task reports are created at all, including "Take a test drive".

    2. Onboarding timing: If the user accesses search before completeOnboarding runs (which creates tasks optimistically), the task won't exist in the report collection that useFilteredOptions reads from.

    For a new Gmail user (classified as individual), the available onboarding choices are EMPLOYER, TRACK_BUSINESS, and TRACK_PERSONAL — all of which include a VIEW_TOUR task ("Take a test drive"). However, if the user's work email merge step associates them with a private domain, they may end up on the MANAGE_TEAM path where the followups suppression activates.

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

    This needs production evidence to confirm which scenario applies. Specifically:

    • Check whether the test account completed onboarding and which engagementChoice was sent to CompleteGuidedSetup
    • Check whether shouldUseFollowupsInsteadOfTasks was true for the account (micro company size + MANAGE_TEAM)
    • Check whether the task report exists in the account's Onyx store when search is opened

    If the root cause is the followups path suppressing tasks, the fix would be in prepareOnboardingOnyxData to ensure the "Take a test drive" task is always created regardless of the followups path (or the search autocomplete should source "Take a test drive" from a different mechanism for followups users).

    If the root cause is timing, the fix would be to ensure completeOnboarding runs before the search bar becomes accessible, or to handle the case where onboarding tasks haven't been created yet.

    What alternative solutions did you explore? (Optional)

    I also investigated whether:

    • The Peggy parser fails to parse "In:" (case-insensitive) — it handles it correctly via the i flag
    • The task report could be filtered by processReport due to empty participants — the task has valid participants (owner + assignee)
    • The maxResults: 10 limit could push the task out — unlikely for a new account with few reports
    • The chat.text filter at L281 could filter it — getReportName correctly converts the HTML task name to "Take a test drive" via Parser.htmlToText

    None of these explain the bug, reinforcing that the task report likely doesn't exist in Onyx at the time of search.

    Possibly related: #79952 (the issue PR #83138 fixed) is about in: autocompleting with type:expense incorrectly — different symptom but same search area.


    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
    External
    on May 16, 2026
  4. added
    Help Wanted
    on May 16, 2026
  5. KJ21-ENG commented on May 16, 2026

    @KJ21-ENG
    Contributor

    Proposal

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

    The search router should show and allow selecting the in:take a test drive autocomplete suggestion, but that report does not appear in the suggestions list.

    What is the root cause of that problem?

    The in: autocomplete branch only ranks reports that are already present in the local options list. In useAutocompleteSuggestions, the IN case calls getSearchOptions(...).recentReports with searchQuery: autocompleteValue, so it can only suggest reports already loaded into listOptions.

    At the same time, SearchAutocompleteList triggers the server report search with getQueryWithoutFilters(autocompleteQueryValue). For an input like in:take, getQueryWithoutFilters returns an empty string because take is a filter value, not a keyword. The debounced search then exits without calling handleSearch, so reports such as the onboarding task "Take a test drive" are never fetched before the local in: suggestions are built.

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

    In SearchAutocompleteList, derive the server-search term from the active autocomplete filter before falling back to getQueryWithoutFilters. When parseForAutocomplete(autocompleteQueryValue) reports autocomplete.key === CONST.SEARCH.SYNTAX_FILTER_KEYS.IN, use the autocomplete value as the debounced handleSearch input. This lets the existing SearchForReports path hydrate matching reports into Onyx, after which the existing useAutocompleteSuggestions IN branch can produce in:take a test drive with the reportID substitution.

    Keep the existing keyword-only behavior for normal free-text search and for filter keys that should not search reports. Add a regression test that verifies typing in:take causes the autocomplete list to search for take, and that once a matching task/report option exists, the suggestion row is rendered with filterKey: in, text Take a test drive, and mapKey: in.

    Scope boundaries:

    • Files touched (with call sites): src/components/Search/SearchAutocompleteList.tsx — server-search term calculation and debounceHandleSearch (around lines 317 and 383); tests/unit/hooks/useAutocompleteSuggestions.test.ts or a focused SearchAutocompleteList test — in: report suggestion regression.
    • Platforms: all platforms using the shared search router/autocomplete components.
    • Code paths / callers explicitly NOT touched: final query normalization in SearchQueryUtils.getQueryWithUpdatedValues, search parser grammar, backend search APIs.
    • API contracts or backend behavior changes: no.

    What alternative solutions did you explore? (Optional)

    Changing getQueryWithoutFilters to return filter values would be broader than this bug because that helper is documented as returning only core keyword text. Expanding useAutocompleteSuggestions to call the API directly would also duplicate the existing debounced handleSearch path in SearchAutocompleteList.

  6. melvin-bot commented on May 16, 2026

    @melvin-bot

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

  7. wildan-m commented on May 16, 2026

    @wildan-m
    Contributor

    Proposal

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

    When a brand-new Gmail user signs in, opens the search router (magnifier icon), and types in: to see chat-based suggestions, the autocomplete dropdown does NOT include the onboarding admin task "Take a test drive" even though that task report exists in the user's data after onboarding. The expected suggestion in:take a test drive never appears, so the user cannot pick the test-drive task as a chat-scope filter.

    What is the root cause of that problem?

    The in: autocomplete entry point lives in useAutocompleteSuggestions and produces suggestions by reading getSearchOptions(...).recentReports and mapping each entry's chat.text to the dropdown row text:

    case CONST.SEARCH.SYNTAX_FILTER_KEYS.IN: {
    // If autocompleteValue is empty or just whitespace and we have already completed keys,
    // return empty array to hide suggestion list (consistent with group-by behavior)
    if (!autocompleteValue.trim() && alreadyAutocompletedKeys.size > 0) {
    return [];
    }
    const filteredReports = getSearchOptions({
    options,
    draftComments,
    betas: betas ?? [],
    isUsedInChatFinder: true,
    includeReadOnly: true,
    searchQuery: autocompleteValue,
    maxResults: 10,
    includeUserToInvite: false,
    includeRecentReports: true,
    includeCurrentUser: false,
    countryCode,
    loginList,
    shouldShowGBR: true,
    visibleReportActionsData,
    policyCollection: policies,
    currentUserAccountID,
    currentUserEmail,
    personalDetails,
    sortedActions,
    conciergeReportID,
    }).recentReports.filter((chat) => {
    if (!chat.text) {
    return false;
    }
    return !alreadyAutocompletedKeys.has(chat.text.toLowerCase());
    });
    return filteredReports.map((chat) => ({
    filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.IN,
    text: chat.text ?? '',
    autocompleteID: chat.reportID,
    mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.IN,
    }));

    chat.text for a report row is set inside createOption to the value returned by getReportName for that report:

    const computedReportName = getReportName(report, reportAttributesDerived);
    reportName = showPersonalDetails
    ? getDisplayNameForParticipant({accountID: accountIDs.at(0), formatPhoneNumber: formatPhoneNumberPhoneUtils}) || formatPhoneNumberPhoneUtils(personalDetail?.login ?? '')
    : computedReportName;
    } else {
    reportName =
    getDisplayNameForParticipant({accountID: accountIDs.at(0), personalDetailsData: personalDetails ?? undefined, formatPhoneNumber: formatPhoneNumberPhoneUtils}) ||
    formatPhoneNumberPhoneUtils(personalDetail?.login ?? '');
    result.keyForList = String(accountIDs.at(0));
    result.alternateText = formatPhoneNumberPhoneUtils(personalDetails?.[accountIDs[0]]?.login ?? '');
    }
    // Set core display properties that are used in SearchOption context
    result.text = reportName;

    For a task report, getReportName returns the raw stored reportName unless it is detected as HTML, in which case it converts it to plain text. The detection and conversion happen here:

    App/src/libs/ReportUtils.ts

    Lines 5778 to 5781 in 809efef

    if (isTaskReport(report)) {
    const taskName = report?.reportName ?? '';
    return Parser.isHTML(taskName) ? Parser.htmlToText(taskName).trim() : taskName.trim();
    }

    Parser.isHTML is intentionally narrow — it only returns true when the input contains an HTML tag (<...>) or a numeric/named HTML entity (&...;):

    App/src/libs/Parser.ts

    Lines 67 to 69 in 809efef

    isHTML(text: string): boolean {
    return /<[^>]+>/.test(text) || /&[#\w]+;/.test(text);
    }

    The onboarding admin task that backs "Take a test drive" is created in OnboardingFlow with a Markdown-formatted title Take a [test drive](<testDriveURL>):

    const testDriveAdminTask: OnboardingTask = {
    type: CONST.ONBOARDING_TASK_TYPE.VIEW_TOUR,
    autoCompleted: false,
    title: ({testDriveURL}) => translate(resolvedLocale, 'onboarding.tasks.testDriveAdminTask.title', {testDriveURL}),
    description: ({testDriveURL}) => translate(resolvedLocale, 'onboarding.tasks.testDriveAdminTask.description', {testDriveURL}),
    };

    The optimistic task report stores that title in reportName after passing it through getParsedComment, which converts Markdown to HTML and lets the getReportName HTML path run cleanly. But the title is also propagated to the server-acknowledged task report, and the value the receiving (newly-signed-in) account ends up reading from Onyx for the test-drive admin task is the Markdown form Take a [test drive](<url>), not the HTML form Take a <a href="<url>">test drive</a>. Because that string contains no <> tags and no &...; entities, Parser.isHTML returns false, the conversion branch is skipped, and getReportName returns the raw Markdown string verbatim.

    That raw Markdown string is what arrives at the in: autocomplete row as chat.text. The dropdown then displays a row whose text reads in:Take a [test drive](https://...) rather than in:take a test drive. From the user's perspective the expected suggestion is "not displayed" — the row that should appear as a clean in:take a test drive chip is instead a long Markdown-link blob that doesn't match what they typed (in) and isn't visually recognizable as the test-drive option. Selecting it is also unhelpful because the substitution-map pipeline keyed on the displayed text cannot resolve a Markdown-link string back to the task report.

    The bug therefore lives in the isTaskReport branch of getReportName: it only normalizes HTML-shaped task titles and leaves Markdown-shaped task titles raw. Any place that consumes getReportName for a task whose stored reportName is Markdown — the in: autocomplete dropdown is the user-visible case here — gets the unrendered Markdown back.

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

    Change the task-report branch of getReportName (src/libs/ReportUtils.ts around lines 5778-5781) so that the returned title is always reduced to plain user-visible text, regardless of whether the stored reportName is HTML or Markdown.

    Concretely:

    1. If the stored task reportName already contains HTML (tags or entities), keep the existing behavior of running it through Parser.htmlToText(...).trim(). That preserves the working code path that other callers rely on.
    2. If Parser.isHTML returns false, do not return the raw string. Instead, first render the Markdown to HTML using Parser.replace(taskName, {...}) (with the same TASK_TITLE_DISABLED_RULES already applied at task-create time, so we don't expand image syntax), then feed the resulting HTML through Parser.htmlToText(...).trim(). The render-then-strip pass collapses [test drive](<url>) into the plain test drive text, yielding Take a test drive.

    The two paths converge on the same shape — plain user-facing text — so callers of getReportName for a task no longer have to know which serialization the backend happened to send. The fix is contained to one function, does not change the reportName storage format, and does not require any change in OptionsListUtils, useAutocompleteSuggestions, or the search router. Every other consumer of getReportName for tasks (LHN row labels, search results header, share-target labels, etc.) also benefits and will stop surfacing raw Markdown brackets in the rare cases they currently can.

    After the change, the in: autocomplete will receive chat.text = "Take a test drive", the dropdown renders the suggestion in:Take a test drive, the row is recognizable to the user, and selecting it produces the expected in:take a test drive filter chip. The same fix transparently handles future onboarding tasks whose titles use Markdown formatting (e.g. createTestDriveAdminWorkspaceTask).

    A regression-proof unit test belongs in tests/unit/ReportUtilsTest exercising getReportName with a task report whose reportName is the literal Markdown Take a [test drive](https://example.com) and asserting the result is Take a test drive.

    Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/90861-task-report-name-markdown?expand=1

    What alternative solutions did you explore? (Optional)

    Normalizing the task title at the autocomplete edge (inside the IN case of useAutocompleteSuggestions) was considered, but it would only fix the dropdown symptom and leave every other getReportName consumer exposed to the same Markdown-bracket leakage. Fixing the bug centrally in getReportName is the smaller and more consistent change.

    Forcing the task reportName to always be HTML at write time was also considered — either at the optimistic creation site or by re-parsing whatever the backend returns. That is broader scope (it touches Onyx data shape and would need a migration story for users who already have Markdown-shaped task names persisted), and getReportName is meant to be the single point where stored-shape variability gets normalized for display, so fixing it there is the right architectural layer.

  8. melvin-bot commented on May 16, 2026

    @melvin-bot
  9. changed the title [-]"Take a test drive" not displayed in suggestions[/-] [+][$250] "Take a test drive" not displayed in suggestions[/+] on May 16, 2026
  10. aswin-s commented on May 16, 2026

    @aswin-s
    Contributor

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

    When a user launches the app on a new account and navigates to the search input, typing "in:" does not display the onboarding "Take a test drive" task report in the suggestion list. The expected behavior is that "in:take a test drive" should appear in the autocomplete suggestions and be selectable. This prevents users from easily filtering their chats by this task report using the IN search operator.

    What is the root cause of that problem?

    The bug originates in src/hooks/useAutocompleteSuggestions.ts in the useAutocompleteSuggestions function at lines 252–292. When the IN autocomplete branch calls getSearchOptions to retrieve recent reports, it returns the report's chat.text field which contains markdown link syntax (e.g., Take a [test drive](https://...)). The substring matching logic applied by getValidOptions attempts to match this raw markdown text against the user's input, causing the match to fail because the plain text "take a test drive" does not match the markdown-formatted string.

    Additionally, even when rendered, the suggestion text displays the raw markdown rather than a friendly title, making the entry unrecognizable to users. The working analog in the CARD_ID case (lines shown in the same file) demonstrates the pattern of filtering and deduplicating by a normalized, user-readable text value before returning suggestions.

    case CONST.SEARCH.SYNTAX_FILTER_KEYS.IN: {
    // If autocompleteValue is empty or just whitespace and we have already completed keys,
    // return empty array to hide suggestion list (consistent with group-by behavior)
    if (!autocompleteValue.trim() && alreadyAutocompletedKeys.size > 0) {
    return [];
    }
    const filteredReports = getSearchOptions({
    options,
    draftComments,
    betas: betas ?? [],
    isUsedInChatFinder: true,
    includeReadOnly: true,
    searchQuery: autocompleteValue,
    maxResults: 10,
    includeUserToInvite: false,
    includeRecentReports: true,
    includeCurrentUser: false,
    countryCode,
    loginList,
    shouldShowGBR: true,
    visibleReportActionsData,
    policyCollection: policies,
    currentUserAccountID,
    currentUserEmail,
    personalDetails,
    sortedActions,
    conciergeReportID,
    }).recentReports.filter((chat) => {
    if (!chat.text) {
    return false;
    }
    return !alreadyAutocompletedKeys.has(chat.text.toLowerCase());
    });
    return filteredReports.map((chat) => ({
    filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.IN,
    text: chat.text ?? '',
    autocompleteID: chat.reportID,
    mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.IN,
    }));

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

    1. File: src/hooks/useAutocompleteSuggestions.ts
      Function: useAutocompleteSuggestions
      Description: Within the SYNTAX_FILTER_KEYS.IN case, add a helper function to strip markdown link syntax. After retrieving recentReports from getSearchOptions, map each report to normalize its text field by removing markdown before using it for matching, deduplication, and display.

      The helper should safely handle null/undefined values and malformed markdown:

      function stripMarkdownLinks(text: string | null | undefined): string {
          if (!text) {
              return '';
          }
          // Replace [label](url) with label; if pattern doesn't match, return text as-is
          return text.replace(/\[([^\]]*)\]\([^)]*\)/g, '$1').trim();
      }

      This regex is deliberately non-greedy and handles malformed markdown gracefully — if the pattern does not match (e.g., plain text with no brackets), replace returns the original string unchanged. The null/undefined guard ensures no runtime errors when report.text or the chat.text field is absent.

      After retrieving recentReports, normalize each entry before matching:

      const normalizedReports = (recentReports ?? [])
          .map((report) => ({
              ...report,
              text: stripMarkdownLinks(report?.text),
          }))
          .filter((report) => report.text.toLowerCase().includes(autocompleteValue.toLowerCase()));

      Use normalizedReports for: (a) the substring match against autocompleteValue.toLowerCase(), (b) the alreadyAutocompletedKeys dedupe check, and (c) the returned text field in the suggestion object. This ensures the suggestion list displays "Take a test drive" verbatim and a user typing "in:take a test drive" will see and be able to select it.

      This fix applies uniformly across Android, iOS, and web (including HybridApp) because useAutocompleteSuggestions is a shared hook with no platform-specific branches in the IN filter path. The markdown stripping happens before any platform-specific rendering, so all surfaces receive the already-normalized plain text string.

    What alternative solutions did you explore?

    • Strip markdown inside getValidOptions/getReportName globally: Rejected because chat.text is consumed by many call sites (LHN, chat finder, mentions) which already render markdown-aware UI. Changing the canonical report name string would risk regressions in those flows. The narrow fix at the IN autocomplete branch only affects the search suggestion list assembly, which is the actual user-visible symptom.
  11. github-actions commented on May 16, 2026

    @github-actions
    Contributor

    ⚠️ @aswin-s Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  12. aswin-s commented on May 16, 2026

    @aswin-s
    Contributor

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

  13. 18 remaining items

  14. added a commit that references this issue on May 16, 2026
    33a0692
  15. zaghouri commented on May 16, 2026

    @zaghouri

    Contributor details
    Your Expensify account email: abderrahim.zaghouri@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~01de4d792ed0b4759b

  16. melvin-bot commented on May 16, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  17. yusufdeveloper2903 commented on May 17, 2026

    @yusufdeveloper2903
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-05-17 07:40:22 UTC.

    Proposal

    What is the root cause of that problem?

    The OP repro is the literal QA plan from PR #83138 (Tests / QA Steps 1–6) — "Login with new gmail account → tap search → enter In: → select take a test drive from suggestions". In the attached repro video the new Gmail account selects "Something else" on the onboarding purpose modal, which maps to LOOKING_AROUND (src/CONST/index.ts:112, label "Something else" at src/languages/en.ts:3027) — also independently confirmed by Applause's recording.

    The defect is one line of data, not parsing or rendering. onboardingLookingAroundMessage is the only onboarding message whose tasks array is empty:

    const onboardingLookingAroundMessage: OnboardingMessage = {
    message: '',
    tasks: [],
    };

    Every other choice (EMPLOYER, SUBMIT, MANAGE_TEAM, TRACK_WORKSPACE, TRACK_PERSONAL, PERSONAL_SPEND, CHAT_SPLIT, ADMIN, TEST_DRIVE_RECEIVER) attaches either testDriveAdminTask or testDriveEmployeeTask — see OnboardingFlow.ts:301-364. prepareOnboardingOnyxData iterates onboardingMessage.tasks to call buildOptimisticTaskReport (ReportUtils.ts:11828-11840) — empty input → no task report is ever written to Onyx. The IN branch of useAutocompleteSuggestions builds its rows from getSearchOptions(...).recentReports (useAutocompleteSuggestions.ts:259-292), which can only ever surface reports that exist locally. No backing report → no suggestion possible, on any platform.

    tasks: [] has been there since the June 2025 refactor commit ec3886fc456 and was untouched by the March 2026 cleanup cb5deac9fe6 ("Remove stale LOOKING_AROUND onboarding message and suppress sign-off"), which only emptied the intro message string and intentionally left tasks alone — i.e. there is no deliberate product decision to deny test drive to "Something else" users. PR #83138 (referenced in the issue body) only adds an in:→type:chat coercion at search submission time (SearchQueryUtils.ts:1867-1879); it is not in the autocomplete population path and is not the cause.

    Disproving the competing mechanisms I traced before settling here:

    • Raw Markdown in getReportName (proposed by another contributor): buildOptimisticTaskReport writes reportName through getParsedComment (ReportUtils.ts:8644), which runs ExpensiMark.replace and stores HTML (Take a <a href="…">test drive</a>). Parser.isHTML returns true for that string (Parser.ts:67-69), so the task branch of getReportName returns clean "Take a test drive". The stored value is not Markdown.
    • excludeHidden filters out the task report (HIDDEN-preference mechanism): the filter at OptionsListUtils/index.ts:2498-2514 is gated by !report.isTaskReport on line 2504 — task reports are explicitly exempted, regardless of notificationPreference.
    • Multi-word continuation gap in CONTINUATION_DETECTION_SEARCH_FILTER_KEYS (my own earlier draft, and another contributor's angle): real adjacent bug, but the OP types only In:. The parser returns autocomplete = {key:'in', value:''} directly (useAutocompleteSuggestions.ts:120-138) — autocomplete is not null, the continuation recovery branch is never entered, and the empty-value guard at line 255 only short-circuits when something is already autocompleted (not the case here). The continuation gap does not explain this OP and should be filed separately.
    • environmentURL async race in buildOptimisticTaskReport: prepareOnboardingOnyxData runs from CompleteGuidedSetup after the user submits the purpose modal — many seconds after app boot, after getEnvironmentURL().then(...) (ReportUtils.ts:1012-1013) has resolved. And even if it did race, LOOKING_AROUND never reaches that code path because tasks is empty.
    • Followups path / onboarding-timing speculation: deterministically ruled out — LOOKING_AROUND's tasks: [] is the immediate, unconditional explanation; shouldUseFollowupsInsteadOfTasks never enters the picture for this choice.

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

    Attach the existing testDriveAdminTask to the LOOKING_AROUND onboarding message at src/libs/actions/Welcome/OnboardingFlow.ts:357-360:

     const onboardingLookingAroundMessage: OnboardingMessage = {
         message: '',
    -    tasks: [],
    +    tasks: [testDriveAdminTask],
     };

    End-to-end trace post-fix (no other file needs editing):

    1. New Gmail user picks "Something else" → engagementChoice = LOOKING_AROUND.
    2. prepareOnboardingOnyxData reaches the .filter() at ReportUtils.ts:11791-11824. The VIEW_TOUR-skip block on lines 11801-11814 only fires when introSelected.choice ∈ {EMPLOYER, PERSONAL_SPEND, TRACK_PERSONAL, SUBMIT, CHAT_SPLIT, MANAGE_TEAM} and engagementChoice === MANAGE_TEAM — LOOKING_AROUND is in neither set, so testDriveAdminTask is kept.
    3. buildOptimisticTaskReport (ReportUtils.ts:8621-8660) writes a task report with type: TASK, reportName set via getParsedComment(...) → HTML, and notificationPreference: HIDDEN. The HIDDEN preference is the right thing here — it keeps the task out of the LHN exactly as the other onboarding paths do today (so this fix does not add LHN noise), while the !report.isTaskReport exemption at OptionsListUtils/index.ts:2504 keeps it visible to in: autocomplete.
    4. User taps search, types In:. The IN branch (useAutocompleteSuggestions.ts:252-292) calls getSearchOptions({searchQuery: ''}).recentReports; the new task report has chat.text = "Take a test drive" via createOption → getReportName and is returned in the top 10 recent reports.
    5. Row renders as in:Take a test drive with autocompleteID = <taskReportID>, mapKey = 'in'. Selecting it produces the substituted chip and, via PR fix: Report - Searching "in" auto completes syntax with type:expense incorrectly.  #83138's coercion at SearchQueryUtils.ts:1867-1879, the submitted query becomes type:chat in:take a test drive — exactly matching step 6 of fix: Report - Searching "in" auto completes syntax with type:expense incorrectly.  #83138's QA expectation.

    A unit-test in tests/unit/OnboardingFlowTest asserting getOnboardingMessages().onboardingMessages[CONST.ONBOARDING_CHOICES.LOOKING_AROUND].tasks contains a task of type CONST.ONBOARDING_TASK_TYPE.VIEW_TOUR locks the regression in.

    What alternative solutions did you explore? (Optional)

    • Inject a synthetic "Take a test drive" suggestion in the IN branch even without a backing task report — rejected: in: chips require an autocompleteID that resolves to a real reportID to filter chats by; without a backing task report the chip selection produces no scope, and the existing test-drive UX (the testDriveAdminTask itself, with its [Take](testDriveURL) link into TestDriveModal) is what the user is actually trying to reach.
    • Lazy-create the test drive task on first search-router open — heavier surface area, race-prone, and inconsistent with the rest of the onboarding-tasks pipeline. The minimal fix is to keep task provisioning in one place (onboardingMessages.LOOKING_AROUND.tasks) like every other choice.
    • Add IN to CONTINUATION_DETECTION_SEARCH_FILTER_KEYS (src/CONST/index.ts:9844-9851) — fixes a real but separate latent defect where multi-word in:<chat name> queries drop autocomplete after the first space; worth a follow-up issue, but not what this OP demonstrates.
  18. github-actions commented on May 17, 2026

    @github-actions
    Contributor

    ⚠️ @yusufdeveloper2903 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  19. abzokhattab commented on May 17, 2026

    @abzokhattab
    Contributor

    I reviewed the repro and confirmed “Something else” was selected during onboarding. That path maps to LOOKING_AROUND, which intentionally creates no onboarding tasks, so there is no “Take a test drive” task report available for in: autocomplete.

    Given that, the expected result is inconsistent with the selected onboarding flow. Reaching out internally to confirm this behaviour is expected

  20. abzokhattab commented on May 18, 2026

    @abzokhattab
    Contributor

    Tagging an internal engineer to confirm

    🎀 👀 🎀 C+ reviewed

  21. melvin-bot commented on May 18, 2026

    @melvin-bot

    Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  22. marcaaron commented on May 19, 2026

    @marcaaron
    Contributor

    I am curious about the test steps on the linked PR. Tester suggests that those steps were removed so not sure why it was sent to QA like that cc @annaweber830 @sobitneupane #83138 (comment)

    Can we close this?

  23. sobitneupane commented on May 19, 2026

    @sobitneupane
    Contributor

    I am curious about the test steps on the linked PR.

    @marcaaron For the linked PR, "Take a test drive" is not required. The original issue was reported in that context, but the problem itself is not specific to it.

    We can update the steps in the PR to:

    1. Launch the app
    2. Login with new gmail account
    3. Tap the search icon
    4. Enter In: and select any chat from the suggestions
    5. Tap enter
    6. Verify that type:chat in included in the search query.
  24. marcaaron commented on May 20, 2026

    @marcaaron
    Contributor

    the problem itself is not specific to it

    Ok, but also seems like there is no problem because this being removed is the expected behavior? Do you agree?

  25. marcaaron commented on May 20, 2026

    @marcaaron
    Contributor

    I am pretty sure there is nothing to fix here so going to close this out.

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

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions