Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 23, 2024 · 11 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 23, 2024

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

@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

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

Copy link
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.

@lanitochka17
Copy link
Author

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

@marcaaron marcaaron added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. and removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API Hourly KSv2 labels Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

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.

@marcaaron
Copy link
Contributor

Not deploy blocker worthy.

@nyomanjyotisa
Copy link
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?

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)

@cretadn22
Copy link
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.

@tsa321
Copy link
Contributor

tsa321 commented Jul 24, 2024

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

@Tony-MK
Copy link
Contributor

Tony-MK commented Jul 24, 2024

This issue is not reproducible on the latest main.

@stephanieelliott
Copy link
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?

@marcaaron
Copy link
Contributor

Works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants