Skip to content

[HOLD for payment 2025-01-13] [$250] Web - Thread - Switching to Search and back after clicking "Join thread" opens the report #52472

Closed

Description

@IuliiaHerets

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.0.61-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): testpayment935+613@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. (User A) Send any message to 1:1 conversation for the account you have access to
  2. (User B) go to the new message from User A and open context menu
  3. (User B) Click "Join Thread"
  4. Navigating to Settings/Search and go to Inbox again

Expected Result:

The "Join Thread" option should not navigate to the report.

Actual Result:

"Join thread" option navigates to the report page after navigating to other bottom navigations like Search or Setting and returning back to inbox.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6663491_1731486430970.bandicam_2024-11-13_11-14-04-868.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021858763130278701100
  • Upwork Job ID: 1858763130278701100
  • Last Price Increase: 2024-12-03
  • Automatic offers:
    • mkzie2 | Contributor | 105221093
Issue OwnerCurrent Issue Owner: @stephanieelliott

Activity

  1. added
    Daily
    Bug
    on Nov 13, 2024
  2. melvin-bot commented on Nov 13, 2024

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. FitseTLT commented on Nov 13, 2024

    @FitseTLT
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-11-13 13:06:19 UTC.

    Proposal

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

    Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again

    What is the root cause of that problem?

    When we press the join button openReport is called with new child report id here

    openReport(newChat.reportID, '', participantLogins, newChat, parentReportAction.reportActionID);

    and that will set the visitedTime of the child report to the current time
    lastVisitTime: DateUtils.getDBTime(),

    so when we navigate back to the inbox the empty child report will be opened as it is the last accessed report according to its visitedTime

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

    We should not set the lastVisitedTime for the child report on join as we are not visiting it only subscribing to it. So:

    add optional shouldSetVisitedTime param for openReport

    shouldSetVisitedTime = true,
    

    lastVisitTime: DateUtils.getDBTime(),

    
    
                    ...(shouldSetVisitedTime && {lastVisitTime: DateUtils.getDBTime()}),
    
    

    and pass as false for open reports in join thread for both when the childReport exists or not

    openReport(childReportID);

            openReport(childReportID, undefined, undefined, undefined, undefined, undefined, undefined, undefined, false);
    
    

    openReport(newChat.reportID, '', participantLogins, newChat, parentReportAction.reportActionID);

            openReport(newChat.reportID, '', participantLogins, newChat, parentReportAction.reportActionID, false);
    
    

    What alternative solutions did you explore? (Optional)

  4. mkzie2 commented on Nov 13, 2024

    @mkzie2
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-11-19 08:56:27 UTC.

    Proposal

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

    "Join thread" option navigating to "reply in thread" page after navigating to other bottom navigations like Search or Setting and returning back to inbox

    What is the root cause of that problem?

    • Firstly, we need to explain why the join thread option is only shown in non-thread actions of other user

    The difference is here, if reportAction?.childReportNotificationPreference is undefined, getChildReportNotificationPreference function returns always if the user is the creator of the action, otherwise it returns hidden

    const childReportNotificationPreference = ReportUtils.getChildReportNotificationPreference(reportAction);

    App/src/libs/ReportUtils.ts

    Lines 1762 to 1768 in b1c1a4b

    function getChildReportNotificationPreference(reportAction: OnyxInputOrEntry<ReportAction> | Partial<ReportAction>): NotificationPreference {
    const childReportNotificationPreference = reportAction?.childReportNotificationPreference ?? '';
    if (childReportNotificationPreference) {
    return childReportNotificationPreference;
    }
    return isActionCreator(reportAction) ? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS : CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;

    • When we click on Join thread, a new report is created and when we go back from search it is displayed as the last accessed report

    function toggleSubscribeToChildReport(childReportID = '-1', parentReportAction: Partial<ReportAction> = {}, parentReportID = '-1', prevNotificationPreference?: NotificationPreference) {

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

    I think the way we update lastVisitTime here is incorrect. It was added here. According to my understanding
    , lastVisitTime saves the last time we opened a report (the report screen is focused).

    lastVisitTime: DateUtils.getDBTime(),

    Call openReport doesn't mean we navigate to this report and we handled in ReportScreen here to update lastVisitTime whenever the ReportScreen is focused so we can remove the wrong logic here

    lastVisitTime: DateUtils.getDBTime(),

    What alternative solutions did you explore? (Optional)

  5. stephanieelliott commented on Nov 19, 2024

    @stephanieelliott
    Contributor

    Agree this seems buggy, adding labels.

  6. added
    External
    on Nov 19, 2024
  7. melvin-bot commented on Nov 19, 2024

    @melvin-bot
  8. changed the title [-]Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again[/-] [+][$250] Web - Thread - Noting happen when clicking "Join thread" button unless returning to inbox again[/+] on Nov 19, 2024
  9. added
    Help Wanted
    on Nov 19, 2024
  10. 54 remaining items

  11. melvin-bot commented on Jan 6, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.80-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-01-13. 🎊

    For reference, here are some details about the assignees on this issue:

  12. melvin-bot commented on Jan 6, 2025

    @melvin-bot

    @parasharrajat @stephanieelliott @parasharrajat The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  13. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Jan 7, 2025
  14. added
    Daily
    and removed
    Weekly
    on Jan 13, 2025
  15. stephanieelliott commented on Jan 15, 2025

    @stephanieelliott
    Contributor

    Hey @parasharrajat can you complete the BZ checklist?

  16. parasharrajat commented on Jan 15, 2025

    @parasharrajat
    Member

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/31424/files#r1917458353

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: Not needed

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    Web/Desktop

    1. [User A] Open the chat with User B
    2. [User B] Send a message to User A
    3. [User A] Hover this message and click on Join thread
    4. [User A] Open the search page and open the inbox again
    5. Verify that user B's inbox is displayed

    mWeb/Native

    1. [User A] Open the chat with User B
    2. [User B] Send a message to User A
    3. [User A] Hover this message and click on Join thread
    4. [User A] Open the deep link with the relative path /r
    5. Verify that user B's inbox is displayed

    Do we agree 👍 or 👎

  17. stephanieelliott commented on Jan 17, 2025

    @stephanieelliott
    Contributor
  18. stephanieelliott commented on Jan 17, 2025

    @stephanieelliott
    Contributor

    Summarizing payment on this issue:

    • Contributor: @mkzie2 $250 via Upwork - PAID!
    • Contributor+: @parasharrajat $250 via ND - please request!

    Upwork job is here: https://www.upwork.com/jobs/~021858763130278701100

  19. moved this from Hold for Payment to Done in #expensify-bugson Jan 17, 2025
  20. parasharrajat commented on Jan 19, 2025

    @parasharrajat
    Member

    Payment requested as per #52472 (comment)

  21. JmillsExpensify commented on Jan 22, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @parasharrajat

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions