Skip to content

Threads - Pin icon doesn't disappear right after user leaves a thread #46084

Closed

Description

@lanitochka17

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


Version Number: 9.0.11-1
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Open a chat
  3. Send a message
  4. Hover over the message and click on reply in thread
  5. Send a message inside the thread
  6. Click on the header of the thread
  7. Click on Pin
  8. Click on Leave
  9. Click on the pinned thread chat you just left

Expected Result:

When clicking 'Leave Thread' in step 8, the pin icon in the thread chat should either disappear, indicating the thread is no longer pinned, or persist when revisiting the thread later, maintaining its pinned status

Actual Result:

When clicking 'Leave Thread' in step 8, the pin icon remains in the left thread chat, but it disappears when revisiting the chat thread before joining

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6550265_1721713379246.bandicam_2024-07-23_08-31-42-765.mp4

27

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    DeployBlockerIndicates it should block deploying the API
    on Jul 23, 2024
  2. melvin-bot commented on Jul 23, 2024

    @melvin-bot

    Triggered auto assignment to @marcaaron (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. github-actions commented on Jul 23, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  4. lanitochka17 commented on Jul 23, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp

  5. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    DeployBlockerCashThis issue or pull request should block deployment
    DeployBlockerIndicates it should block deploying the API
    on Jul 23, 2024
  6. melvin-bot commented on Jul 23, 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.

  7. marcaaron commented on Jul 23, 2024

    @marcaaron
    Contributor

    Not deploy blocker worthy.

  8. nyomanjyotisa commented on Jul 24, 2024

    @nyomanjyotisa
    Member

    Proposal

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

    Pin icon doesn't disappear right after user leaves a thread

    What is the root cause of that problem?

    We don't handle to set the isPinned value to false on leave action here

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

    Set isPinned to false optimistically on leave action here

                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
                    value: {isPinned: false},
                }
    

    What alternative solutions did you explore? (Optional)

  9. cretadn22 commented on Jul 24, 2024

    @cretadn22
    Contributor

    Proposal

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

    Pin icon doesn't disappear right after user leaves a thread

    What is the root cause of that problem?

    In this scenario, despite isHidden being true, shouldOverrideHidden is also true (due to report.isPinned being true). Therefore, isPinned will still be visible in LHN.

    const shouldOverrideHidden = hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned;
    if (isHidden && !shouldOverrideHidden) {
    return;
    }

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

    const shouldOverrideHidden = hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned;

    remove report.isPinned condition

    What alternative solutions did you explore? (Optional)

    App/src/libs/actions/Report.ts

    Lines 2731 to 2740 in 2bb1d00

    value:
    isWorkspaceMemberLeavingWorkspaceRoom || isChatThread
    ? {
    notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
    }
    : {
    reportID: null,
    stateNum: CONST.REPORT.STATE_NUM.APPROVED,
    statusNum: CONST.REPORT.STATUS_NUM.CLOSED,
    notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,

    When setting notificationPreference to CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN, we must also ensure that isPinned is set to false.

  10. tsa321 commented on Jul 24, 2024

    @tsa321
    Contributor

    Maybe the the expected result is not to automatically unpin the thread report, then this issue would be the back end issue.

  11. Tony-MK commented on Jul 24, 2024

    @Tony-MK
    Contributor

    This issue is not reproducible on the latest main.

  12. stephanieelliott commented on Jul 25, 2024

    @stephanieelliott
    Contributor

    I'm also unable to repro this. Reproduction aside, seeing as this is a pretty minor issue that only affects threads and falls under a project that's currently paused, IMO this is not worth investigating much further. I think we should close this as Not a priority, @marcaaron what do you think?

  13. marcaaron commented on Jul 26, 2024

    @marcaaron
    Contributor

    Works for me!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions