Skip to content

[$250] Chat - "It´s {Time} for {Name}" label is not displayed above composer on 1:1 chat. #92225

Closed

Description

@applause-bot

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.90-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #91416
Email or phone of affected tester (no customers): ibellicotest+2723@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Chat Report View

Action Performed:

  1. Open the Expensify app.
  2. Open any 1:1 chat.
  3. Note that no "It´s {Time} for {Name}" label, showing the other user´s time is visible above composer.

Expected Result:

A "It´s {Time} for {Name}" label showing the actual time in the other user´s timezone should be visible above composer in 1:1 chats.

Actual Result:

A "It´s {Time} for {Name}" label showing the actual time in the other user´s timezone is not visible above composer after opening a 1:1 chat.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7168482_1780314053297.Chat_Tests.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7168482

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @JS00001

Activity

  1. applause-bot commented on Jun 1, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/114ab8b1b8b681defb3ed10644cf9a62b60bde9d73bd5063e049df6768e91284

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

    @MelvinBot
    Contributor

    Proposal

    Regression analysis (medium confidence). The label works in steady state but breaks on a specific async load ordering, which is why it reproduces on a slower hybrid device (MotoG60 / Android 12) but not on a warm web session.

    This is a regression introduced by #91416 ("refactor: remove personalDetails from ReportActionsList dependencies"), the same PR this bug was caught QAing. That PR is the only recent change to this code, and a browser repro on current main confirms the label still renders correctly for already-cached 1:1 DMs (Concierge, qa.guide) — so the steady-state logic is fine. The break is in how eligibility is recomputed while data hydrates.

    What is the root cause of that problem?

    PR #91416 moved the recipient‑local‑time eligibility check out of an inline calculation over the full personal‑details list and into useOnyx selectors that close over asynchronously‑loaded values:

    Neither useOnyx call passes those closed‑over values in the third dependencies argument. useOnyx's snapshot cache only forces the selector to re‑run when (a) the subscribed key (PERSONAL_DETAILS_LIST) changes, (b) the dependencies array changes, or (c) the selector's function identity changes. Since report / currentUserAccountID are neither the subscribed key nor declared dependencies, a correct recompute relies entirely on React Compiler emitting a new selector reference when those values change. When report (or currentUserAccountID) hydrates across several renders — common on slower devices — the eligibility result gets cached as false and can stay stale, so the label never appears. The shouldShow ? gate then chains the recipient lookup behind that stuck flag, compounding it.

    Evidence & mechanism detail
    • Old code computed canShowReportRecipientLocalTime(personalDetails, report, accountID) inline on every render from the live full list, so it always reflected the current report — no cache contract to get stale.
    • The eligibility guard itself is unchanged and correct: ReportUtils.ts:3182-3196 (requires exactly one recipient, not a room/expense chat, recipient present, timezone.selected, and validated).
    • The selector‑cache contract lives in react-native-onyx useOnyx (OnyxSnapshotCache keys results by selector identity; getSnapshot early‑returns the cached result unless the source value, the dependencies, or the selector identity changed). Passing dependencies explicitly invalidates that cache — which is the pattern other selector call sites in the repo already follow via useMemo + a dependency list.
    • Browser repro on main: label shows for Concierge ("It's 3:38 PM for Expensify") and qa.guide, and is correctly absent for a user with no selected timezone — confirming steady state works and the failure is load‑order/device‑timing specific (reported platform: Android hybrid).
    • Test gap: the PR's [useReportRecipientLocalTime.test.ts] covers "personal details load after mount with a stable report", but nothing covers "report (or currentUserAccountID) hydrates after mount" — the exact ordering that regresses.

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

    Make the selector dependency contract explicit instead of relying on the compiler:

    1. In useReportRecipientLocalTime, build the selector with useMemo keyed on [report, currentUserAccountID] and pass [report, currentUserAccountID] as the third useOnyx dependencies argument.
    2. In ComposerLocalTime, do the same for the recipient selector (key it on the recipient account ID and pass that as dependencies), and drop the shouldShow ? gate at line 22 — the existing isEmptyObject(reportRecipient) guard already handles missing data, so gating the fetch on the eligibility flag is unnecessary and brittle.
    3. Add a regression test for the "report/currentUserAccountID hydrate after mount" ordering so this can't silently regress again.

    What alternative solutions did you explore? (Optional)

    Revert ComposerLocalTime / useReportRecipientLocalTime to the previous inline computation over usePersonalDetails(). Simplest and definitely correct, but it reintroduces the full‑list subscription that #91416 removed for performance, so the targeted dependencies fix above is preferred.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/92225) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

    This appears to be a regression from #91416 — the team may prefer to route it back to that PR's author rather than the contributor flow.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 1, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 1, 2026
  6. MobileMage commented on Jun 1, 2026

    @MobileMage
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-06-01 12:51:25 UTC.

    Proposal

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

    Opening any 1:1 chat no longer shows the "It's {Time} for {Name}" row above the composer. The row is expected for validated DMs whose recipient has a selected timezone, and it was rendering correctly before the refactor in PR #91416 landed in 9.3.90-0.

    What is the root cause of that problem?

    PR #91416 (commit fbdeb0d27a2) replaced the inline usePersonalDetails() read in ComposerLocalTime with two independent useOnyx(PERSONAL_DETAILS_LIST, {selector: ...}) subscriptions — one wrapped in a new useReportRecipientLocalTime hook that returns a boolean, and one local subscription that resolves the recipient object. Before the change, both the eligibility check and the recipient lookup ran inline against the same personalDetails reference, so they were always consistent within a single render:

    function ComposerLocalTime() {
    const {reportID} = useComposerState();
    const [isComposerFullSize = false] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${reportID}`);
    const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
    const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
    const canShowRecipientLocalTime = useReportRecipientLocalTime({report});
    const shouldShow = canShowRecipientLocalTime && !isComposerFullSize;
    const reportRecipientAccountID = getReportRecipientAccountIDs(report, currentUserAccountID).at(0);
    const [reportRecipient] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailByAccountIDSelector(shouldShow ? reportRecipientAccountID : undefined)});
    if (!shouldShow || isEmptyObject(reportRecipient) || isAgentEmail(reportRecipient?.login)) {
    return null;
    }

    After the refactor, the second useOnyx is gated on shouldShow before it will ever return the recipient:

    const reportRecipientAccountID = getReportRecipientAccountIDs(report, currentUserAccountID).at(0);
    const [reportRecipient] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
        selector: personalDetailByAccountIDSelector(shouldShow ? reportRecipientAccountID : undefined),
    });

    The selector is built with personalDetailByAccountIDSelector(undefined) (which always returns undefined) on every render where shouldShow is false, and only switches to personalDetailByAccountIDSelector(reportRecipientAccountID) once useReportRecipientLocalTime flips its boolean. Meanwhile useReportRecipientLocalTime recreates canShowReportRecipientLocalTimeSelector(report, currentUserAccountID) as a brand-new closure on every render (no useMemo, no dependencies array passed to useOnyx):

    function useReportRecipientLocalTime({report}: UseReportRecipientLocalTimeParams): boolean {
    const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
    const [canShowRecipientLocalTime = false] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: canShowReportRecipientLocalTimeSelector(report, currentUserAccountID)});
    return canShowRecipientLocalTime;
    }

    Because the selector reference changes every render, the Onyx hook generates a fresh cacheKey and treats each render as a new consumer, but more importantly the boolean flip from false → true is decoupled from the recipient resolution. On the render where shouldShow finally becomes true, the second useOnyx's selector closure is also rebuilt with the new reportRecipientAccountID, and useSyncExternalStore schedules an additional snapshot read — but the early return if (!shouldShow || isEmptyObject(reportRecipient) || isAgentEmail(reportRecipient?.login)) runs before the second subscription has materialized the recipient from PERSONAL_DETAILS_LIST, so the component returns null and stays mounted as null. The Onyx callback for PERSONAL_DETAILS_LIST then never fires again (the underlying data did not change — only the local closure-captured accountID did), and useSyncExternalStore never re-evaluates, so the label is permanently hidden until the chat is remounted (e.g. by tapping into another chat and back). This matches what users see in 9.3.90-0: the row is simply missing for "any 1:1 chat" they open.

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

    Two coupled changes restore correctness while preserving the perf intent of PR #91416. First, remove the shouldShow gate on the recipient selector in ComposerLocalTime so that the recipient subscription is always alive once a reportRecipientAccountID exists — this guarantees that when useReportRecipientLocalTime flips to true, the recipient is already populated in the same render. Second, stabilise the selector inside useReportRecipientLocalTime with useMemo and pass [report, currentUserAccountID] as the third dependencies argument to useOnyx, which is the documented pattern Onyx uses to invalidate its snapshot cache when closure-captured values change (see useTransactionThread for a reference call site):

    const [transactionThreadReportActions] = useOnyx(
    `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
    {
    selector: (reportActions) => selectTransactionThreadReportActions(!!canPerformWriteAction, transactionThreadReportID, reportActions),
    },
    [canPerformWriteAction, transactionThreadReportID],
    );

    The key edit in ComposerLocalTime is dropping the shouldShow ? guard on the selector and letting personalDetailByAccountIDSelector itself handle the undefined account-ID case, while keeping the existing !shouldShow early return to suppress the row:

    const reportRecipientAccountID = getReportRecipientAccountIDs(report, currentUserAccountID).at(0);
    const [reportRecipient] = useOnyx(
        ONYXKEYS.PERSONAL_DETAILS_LIST,
        {selector: personalDetailByAccountIDSelector(reportRecipientAccountID)},
        [reportRecipientAccountID],
    );

    And in useReportRecipientLocalTime, memoise the selector and forward dependencies so Onyx re-evaluates against the freshest closure:

    const selector = useMemo(
        () => canShowReportRecipientLocalTimeSelector(report, currentUserAccountID),
        [report, currentUserAccountID],
    );
    const [canShowRecipientLocalTime = false] = useOnyx(
        ONYXKEYS.PERSONAL_DETAILS_LIST,
        {selector},
        [report, currentUserAccountID],
    );

    This is safe for ReportActionsListPaddingView (the other caller) because that wrapper only consumes the boolean for padding and is unaffected by recipient-resolution timing. It also preserves the perf goal of PR #91416 — ReportActionsList still avoids subscribing to the full PERSONAL_DETAILS_LIST collection — and brings ComposerLocalTime back in line with the pre-PR behavior where eligibility and recipient resolution were resolved against the same snapshot in a single render.

    What alternative solutions did you explore? (Optional)

    Reverting ComposerLocalTime to read usePersonalDetails() directly (the pre-PR pattern) would fix the bug with a smaller diff, but it re-introduces a full-collection subscription on the composer which would re-render on every unrelated profile update — exactly the regression PR #91416 was sent to fix. Stabilising the selector + ungating the recipient subscription keeps the perf win and is the minimal correctness patch.

  7. yusufdeveloper2903 commented on Jun 1, 2026

    @yusufdeveloper2903
    Contributor

    Proposal

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

    In a 1:1 chat, the "It's {Time} for {Name}" label that should appear above the composer (showing the other user's local time) is never displayed. This happens on both standalone (web) and HybridApp, and reproduces in staging and production.

    What is the root cause of that problem?

    The label is rendered by ComposerLocalTime, which only renders ParticipantLocalTime when useReportRecipientLocalTime (i.e. canShowReportRecipientLocalTime) returns true:

    const canShowRecipientLocalTime = useReportRecipientLocalTime({report});
    const shouldShow = canShowRecipientLocalTime && !isComposerFullSize;
    const reportRecipientAccountID = getReportRecipientAccountIDs(report, currentUserAccountID).at(0);
    const [reportRecipient] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailByAccountIDSelector(shouldShow ? reportRecipientAccountID : undefined)});
    if (!shouldShow || isEmptyObject(reportRecipient) || isAgentEmail(reportRecipient?.login)) {
    return null;
    }

    canShowReportRecipientLocalTime requires the recipient's personal details to contain both validated === true and a timezone.selected:

    App/src/libs/ReportUtils.ts

    Lines 3182 to 3196 in cae92c2

    function canShowReportRecipientLocalTime(personalDetails: OnyxEntry<PersonalDetailsList>, report: OnyxEntry<Report>, accountID: number): boolean {
    const reportRecipientAccountIDs = getReportRecipientAccountIDs(report, accountID);
    const hasMultipleParticipants = reportRecipientAccountIDs.length > 1;
    const reportRecipient = personalDetails?.[reportRecipientAccountIDs[0]];
    const reportRecipientTimezone = reportRecipient?.timezone ?? CONST.DEFAULT_TIME_ZONE;
    const isReportParticipantValidated = reportRecipient?.validated ?? false;
    return !!(
    !hasMultipleParticipants &&
    !isChatRoom(report) &&
    !isPolicyExpenseChat(getRootParentReport({report})) &&
    reportRecipient &&
    reportRecipientTimezone?.selected &&
    isReportParticipantValidated
    );
    }

    The problem is that, when a 1:1 chat is opened, the recipient's entry in PERSONAL_DETAILS_LIST does not contain timezone or validated. Those richer fields are only fetched by the OpenPublicProfilePage command, which today is only triggered when you actually open someone's profile (ProfilePage calls it on mount):

    function openPublicProfilePage(accountID: number) {
    const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.PERSONAL_DETAILS_METADATA>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.PERSONAL_DETAILS_METADATA,
    value: {
    [accountID]: {
    isLoading: true,
    },
    },
    },
    ];
    const successData: Array<OnyxUpdate<typeof ONYXKEYS.PERSONAL_DETAILS_METADATA>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.PERSONAL_DETAILS_METADATA,
    value: {
    [accountID]: {
    isLoading: false,
    },
    },
    },
    ];
    const failureData: Array<OnyxUpdate<typeof ONYXKEYS.PERSONAL_DETAILS_METADATA>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.PERSONAL_DETAILS_METADATA,
    value: {
    [accountID]: {
    isLoading: false,
    },
    },
    },
    ];
    const parameters: OpenPublicProfilePageParams = {accountID};
    API.read(READ_COMMANDS.OPEN_PUBLIC_PROFILE_PAGE, parameters, {optimisticData, successData, failureData});
    }

    const timezone = details?.timezone;
    const reportRecipient = personalDetails?.[accountID];
    const isParticipantValidated = reportRecipient?.validated ?? false;
    // If we have a reportID param this means that we
    // arrived here via the ParticipantsPage and should be allowed to navigate back to it
    const shouldShowLocalTime = !hasAutomatedExpensifyAccountIDs([accountID]) && !isAgentEmail(login) && !isEmptyObject(timezone) && isParticipantValidated;

    Because the chat-open flow never loads the recipient's timezone/validated, reportRecipient?.validated ?? false evaluates to false, the gate returns false, and the label is hidden.

    I confirmed this live in the dev app. In a real 1:1 DM the recipient's personal details were only {login, displayName, firstName} — no validated, no timezone — and the label was absent. The moment I merged {validated: true, timezone: {selected: 'Asia/Tashkent'}} into that recipient's personal details, the label rendered immediately ("It's 5:39 PM for Yusuf"). So the gate is the sole blocker, and the missing timezone/validated data is the cause.

    Note: PR #91416 (linked in the report as the QA context) only refactored this path — it moved the same logic into useReportRecipientLocalTime + a useOnyx selector reading the same PERSONAL_DETAILS_LIST. It is behavior-preserving and is not the cause; the bug reproduces in production independently of it.

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

    Make the 1:1 chat-open flow fetch the recipient's full personal details, exactly the way ProfilePage already does, so the local-time gate has the timezone/validated it needs.

    Concretely, when a report is a 1:1 chat, fetch the recipient's public profile for the single report recipient returned by getReportRecipientAccountIDs(report, currentUserAccountID):

    • Add a small effect that runs when the report is opened/changes — a natural home is alongside the existing report-open logic in ReportScreen (src/pages/inbox/ReportScreen.tsx), or in a dedicated hook used by the report footer. For a 1:1 chat with a single non-Expensify recipient whose personalDetails[recipientAccountID] is missing timezone/validated, call PersonalDetails.openPublicProfilePage(recipientAccountID) once.

    This reuses the existing OPEN_PUBLIC_PROFILE_PAGE read command (same call ProfilePage makes), so once it resolves, canShowReportRecipientLocalTime returns true for validated recipients with a selected timezone and the label appears.

    This does not regress other paths:

    • Group chats / rooms / policy-expense chats already return false from the gate (and getReportRecipientAccountIDs returns >1 or 0 recipients), so no fetch/label there.
    • Unvalidated recipients still resolve to validated !== true, so the label correctly stays hidden — matching the existing intentional behavior shared with ProfilePage.
    • Expensify/agent accounts are still excluded via isAgentEmail / EXPENSIFY_ACCOUNT_IDS.

    What alternative solutions did you explore? (Optional)

    1. Backend fix in OpenReport — have the server include timezone/validated for 1:1 participants in the OpenReport response, so no extra client request is needed. This is arguably the cleanest long-term fix, but it's a backend change and may be heavier than necessary for NewDot.
    2. Fetch from the local-time component itself — trigger openPublicProfilePage from ComposerLocalTime/useReportRecipientLocalTime. Rejected because that component early-returns null while the gate is false (chicken-and-egg: it's false precisely because the data is missing), so the fetch must be driven independently of shouldShow, at the report level.
    3. Relax the gate (drop the validated requirement) — rejected: the validated condition is intentional and is shared with ProfilePage's shouldShowLocalTime; showing local time for unvalidated accounts with an unreliable/default timezone would be wrong and inconsistent.
  8. David-2002065 commented on Jun 1, 2026

    @David-2002065
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #91416 split a single inline computation into a two-stage subscription chain that subscribes to PERSONAL_DETAILS_LIST twice and chains the second subscription behind the first via the shouldShow ? ternary. That chaining is the bug — not the selectors per se.

    Both subscriptions live in the same component tree:

    1. useReportRecipientLocalTime → useOnyx(PERSONAL_DETAILS_LIST, {selector: canShowReportRecipientLocalTimeSelector(report, currentUserAccountID)}) returns only the boolean canShow:
      https://github.com/Expensify/App/blob/main/src/hooks/useReportRecipientLocalTime.ts#L13-L19

    2. ComposerLocalTime then re-subscribes to PERSONAL_DETAILS_LIST to materialize the recipient object, but the selector argument is gated by the boolean from step 1:
      https://github.com/Expensify/App/blob/main/src/pages/inbox/report/ReportActionCompose/ComposerLocalTime.tsx#L19-L26

      const [reportRecipient] = useOnyx(
          ONYXKEYS.PERSONAL_DETAILS_LIST,
          {selector: personalDetailByAccountIDSelector(shouldShow ? reportRecipientAccountID : undefined)},
      );

    On the first render after opening a 1:1 chat, report from useOnyx(REPORT_<id>) is briefly undefined (cache miss while the Onyx connection settles for that key). canShowReportRecipientLocalTime short-circuits to false because getReportRecipientAccountIDs(undefined, ...) returns [] and reportRecipient is therefore undefined inside the eligibility check:
    https://github.com/Expensify/App/blob/main/src/libs/ReportUtils.ts#L3182-L3196

    That false is cached against the first-render selector reference in OnyxSnapshotCache. Step 2 sees shouldShow=false, so its selector is personalDetailByAccountIDSelector(undefined) — a function whose entire range is undefined. Onyx caches undefined for THAT selector reference too.

    When report finally arrives on the next render, the new selector closure in step 1 closes over the populated report — but neither useOnyx call passes the closed-over values via the third dependencies argument, so OnyxSnapshotCache.invalidateForKey is never invoked. With the cache un-invalidated, step 1 keeps returning the stale false, which keeps step 2's selector permanently in its always-undefined branch. The early return if (!shouldShow || isEmptyObject(reportRecipient) || ...) fires and the row is permanently hidden until the chat is unmounted/remounted. The bug only reproduces in HybridApp / slower devices because that's where the multi-render hydration window is wide enough to seed the stale cache; the PR author's MacOS recording (Test 7 in the PR) never hit that window, which is why CI green-lit it.

    The OLD code didn't have this failure mode because it pulled personalDetails from the shared OnyxListItemProvider context — one stable subscription that re-rendered consumers on every change of the full list, with no per-selector cache layer between the data and the eligibility check.

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

    Collapse the two-stage chain into a single subscription that returns the eligible recipient (or undefined), and derive shouldShow synchronously from that recipient. This removes the cross-subscription cache race entirely and makes the hook return shape consistent with what the consumer actually needs to render.

    Replace useReportRecipientLocalTime so it returns the recipient (already filtered by eligibility) instead of a bare boolean:

    -function useReportRecipientLocalTime({report}: UseReportRecipientLocalTimeParams): boolean {
    -    const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
    -    const [canShowRecipientLocalTime = false] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: canShowReportRecipientLocalTimeSelector(report, currentUserAccountID)});
    -    return canShowRecipientLocalTime;
    +function useReportRecipientLocalTime({report}: UseReportRecipientLocalTimeParams): OnyxEntry<PersonalDetails> {
    +    const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
    +    const selector = useMemo(
    +        () => (personalDetailsList: OnyxEntry<PersonalDetailsList>) =>
    +            canShowReportRecipientLocalTime(personalDetailsList, report, currentUserAccountID)
    +                ? personalDetailsList?.[getReportRecipientAccountIDs(report, currentUserAccountID).at(0) ?? CONST.DEFAULT_NUMBER_ID]
    +                : undefined,
    +        [report, currentUserAccountID],
    +    );
    +    const [eligibleRecipient] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector}, [report, currentUserAccountID]);
    +    return eligibleRecipient;
    }

    Then in ComposerLocalTime, drop the second useOnyx entirely and let one subscription carry both the eligibility and the recipient:

    -    const canShowRecipientLocalTime = useReportRecipientLocalTime({report});
    -    const shouldShow = canShowRecipientLocalTime && !isComposerFullSize;
    -    const reportRecipientAccountID = getReportRecipientAccountIDs(report, currentUserAccountID).at(0);
    -    const [reportRecipient] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailByAccountIDSelector(shouldShow ? reportRecipientAccountID : undefined)});
    -
    -    if (!shouldShow || isEmptyObject(reportRecipient) || isAgentEmail(reportRecipient?.login)) {
    +    const reportRecipient = useReportRecipientLocalTime({report});
    +    if (isComposerFullSize || isEmptyObject(reportRecipient) || isAgentEmail(reportRecipient?.login)) {
             return null;
         }

    ReportActionsListPaddingView (the other caller) only needs a boolean for padding — adapt it to Boolean(useReportRecipientLocalTime({report})); the perf intent of PR #91416 is preserved because the selector still returns nothing (or one entry) instead of the full collection, so unrelated profile updates still don't re-render the list.

    I'd also add a regression test that mounts ComposerLocalTime with report = undefined first and then merges the report after — the existing tests/unit/ComposerLocalTimeTest.tsx only covers the path where everything is in Onyx before render, which is precisely why this slipped through PR #91416's suite.

    What alternative solutions did you explore? (Optional)

    1. Keep the two-stage chain and just memoize selectors + pass dependencies to both useOnyx calls (the most popular framing in the existing proposals). This fixes the cache invalidation but leaves the chained-subscription design in place, which is the real fragility — anyone touching this code in the future would re-introduce the same trap as soon as they tweak the gate condition. The single-subscription rewrite is the same lines-of-code budget and removes the footgun.

    2. Revert ComposerLocalTime to usePersonalDetails() context. Smallest correctness diff but re-introduces the full-collection subscription PR refactor: remove personalDetails from ReportActionsList dependencies #91416 explicitly removed. Rejected to preserve the perf win for the composer path.

    3. Fetch the recipient's openPublicProfilePage on chat open so validated/timezone are present. That fixes a different failure mode (recipient genuinely missing those fields) but does not explain the QA report's "any 1:1 chat" phrasing, and would not fix the cache-race regression itself — once the recipient is hydrated, the stale false still wins until remount.

  9. melvin-bot commented on Jun 1, 2026

    @melvin-bot

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

  10. changed the title [-]Chat - "It´s {Time} for {Name}" label is not displayed above composer on 1:1 chat.[/-] [+][$250] Chat - "It´s {Time} for {Name}" label is not displayed above composer on 1:1 chat.[/+] on Jun 1, 2026
  11. melvin-bot commented on Jun 1, 2026

    @melvin-bot
  12. github-actions commented on Jun 1, 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.

  13. 18 remaining items

  14. dmkt9 commented on Jun 2, 2026

    @dmkt9
    Contributor

    @VickyStash Yes, I can. I just opened a new chat with someone I hadn't chatted with before

    Is it a person from another timezone? The label won't be shown if the user is in the same time zone.

    @VickyStash I wonder why we only show that label for users in different time zones. The user doesn't know whether the person they're chatting with is in the same time zone or not.

    Anyway, I noticed that we currently show the label even when the other user is in the same time zone:

    Image
  15. heroking777 commented on Jun 2, 2026

    @heroking777

    Strategic Response to the Problem Context

    Understanding the Core Issues

    The primary issues identified in the context revolve around two main areas:

    1. Data Fetching and Availability for Local Time Display

      • The application fails to fetch essential personal details (like timezone and validation status) for 1:1 chat participants when a report is opened.
      • This results in the local time display feature not functioning as intended, even though it should be available for validated accounts with selected timezones.
    2. Selector Caching and Dependency Management

      • The useOnyx hook selectors used in components like ComposerLocalTime and useReportRecipientLocalTime do not include dependencies.
      • This leads to stale data being served from the cache, causing the local time display feature to fail even when the necessary data is available.

    Root Cause Analysis

    1. Data Fetching Root Cause

      • The current implementation does not trigger a fetch for personal details of 1:1 chat participants upon report opening.
      • This contrasts with how ProfilePage handles this, making it inconsistent and leading to missing data in the local time display feature.
    2. Selector Caching Root Cause

      • The absence of dependencies in useOnyx selectors causes them to rely solely on their initial state or cached values.
      • When external variables like report, currentUserAccountID, shouldShow, and reportRecipientAccountID change, the selectors do not re-evaluate, leading to stale data being used.

    Proposed Solutions

    1. Data Fetching Solution

      • Implement a mechanism in ReportScreen or a dedicated hook to fetch personal details for 1:1 chat participants when a report is opened.
      • This should be done conditionally only for 1:1 chats with non-Expensify recipients who lack the necessary timezone and validation data.
    2. Selector Caching Solution

      • Update useOnyx selectors to include dependencies that reflect the external values they close over.
      • Specifically, add [report, currentUserAccountID] as dependencies in useReportRecipientLocalTime and [shouldShow, reportRecipientAccountID] in ComposerLocalTime.
      • This ensures that the selectors re-evaluate when their dependencies change, preventing stale data from being used.

    Implementation Strategy

    1. Data Fetching Implementation
      • Locate the appropriate place to trigger the fetch (e.g., within `

    I have already identified the root cause of this issue and have a verified fix and Pull Request ready to submit. If you are aligned with the budget and payment terms, please establish the contract on Upwork, and I will submit the solution immediately.

  16. dmkt9 commented on Jun 4, 2026

    @dmkt9
    Contributor

    This looks like a backend issue, since the openReport API doesn't return the validated and timezone fields for the recipient:

    Image

    🎀 👀 🎀 C+ reviewed

  17. melvin-bot commented on Jun 4, 2026

    @melvin-bot

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

  18. JS00001 commented on Jun 4, 2026

    @JS00001
    Contributor

    I see the label on production 🤔

    Also, are we sure this is a BE issue? How would this feature have worked before if it was a BE issue?

  19. KJ21-ENG commented on Jun 4, 2026

    @KJ21-ENG
    Contributor

    @JS00001 backend must provide the missing recipient timezone reliably, and FE should avoid showing default/wrong local time when it is absent. updated my proposal for same

  20. dmkt9 commented on Jun 4, 2026

    @dmkt9
    Contributor

    I see the label on production 🤔

    Also, are we sure this is a BE issue? How would this feature have worked before if it was a BE issue?

    @JS00001 I think it was ignored because this issue can only be reproduced with an account that hasn’t been chatted with before.

    For example, you can open a chat with my test account: dmkt9x+test26068@gmail.com

  21. KJ21-ENG commented on Jun 4, 2026

    @KJ21-ENG
    Contributor

    I think it was ignored because this issue can only be reproduced with an account that hasn’t been chatted with before.

    For example, you can open a chat with my test account: dmkt9x+test26068@gmail.com

    I agree with this, as I was also able to reproduce the issue only with accounts where I haven't opened any chats yet.

  22. JS00001 commented on Jun 8, 2026

    @JS00001
    Contributor

    Looking at this today

  23. JS00001 commented on Jun 8, 2026

    @JS00001
    Contributor

    Looking at the BE, this looks intentional. We send a limited set of personal details for users who the user has no history with. I dont think this is worth fixing so I'm going to close this issue

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions