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

[HOLD for payment 2024-04-05] [$500] Not able to share logs to own self DM from "Debug console" #38147

Closed
2 of 6 tasks
m-natarajan opened this issue Mar 12, 2024 · 45 comments
Closed
2 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Mar 12, 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: 1.4.50-5
Reproducible in staging?: y
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1710208120099339

Action Performed:

  1. Open app
  2. Go to settings > about> troubleshoot
  3. Toggle client side logging> view debug console
  4. Click share logs

Expected Result:

User should be able to share to own DM to access in desktop

Actual Result:

Does not give the option in the list

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

RPReplay_Final1710258700.MP4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013e74b76766270067
  • Upwork Job ID: 1767616215332700160
  • Last Price Increase: 2024-03-19
Issue OwnerCurrent Issue Owner: @mkhutornyi
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@CortneyOfstad
Copy link
Contributor

Was able to recreate — believe this falls under VIP-VSB 👍

@CortneyOfstad
Copy link
Contributor

Asked here

@CortneyOfstad
Copy link
Contributor

Alright, David confirmed it is under VIP-VSB – going to have the priority be low, as the logs can be downloaded or sent into an admin channel as workarounds.

@CortneyOfstad CortneyOfstad added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Mar 12, 2024
@melvin-bot melvin-bot bot changed the title Not able to share logs to own self DM from "Debug console" [$500] Not able to share logs to own self DM from "Debug console" Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~013e74b76766270067

Copy link

melvin-bot bot commented Mar 12, 2024

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Mar 12, 2024

Proposal

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

The user is unable to share logs to self dm

What is the root cause of that problem?

in the getShareLogOptions we don't include the self-dm in the options results

function getShareLogOptions(reports: OnyxCollection<Report>, personalDetails: OnyxEntry<PersonalDetailsList>, searchValue = '', betas: Beta[] = []): GetOptions {
return getOptions(reports, personalDetails, {
betas,
searchInputValue: searchValue.trim(),
includeRecentReports: true,
includeMultipleParticipantReports: true,
sortByReportTypeInSearch: true,
includePersonalDetails: true,
forcePolicyNamePreview: true,
includeOwnedWorkspaceChats: true,
});
}
/**

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

add includeSelfDM, includeThreads to show the self dms including all their threads similar to what we are doing in the searchPage

        includeSelfDM:true,
        includeThreads: true,

this way we are sure that no regressions will occur in the getOptions function

@agent3bood
Copy link
Contributor

agent3bood commented Mar 12, 2024

Proposal

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

Not able to share logs to own self DM from "Debug console"

What is the root cause of that problem?

This is a two parts issue.

First we need to set includeSelfDM: true in this function call to pass this condition.

Second we need to remove {login: currentUserLogin} from here

It is safe to remove {login: currentUserLogin} from optionsToExclude because we are controlling weather self is included in the options or not by the includeSelfDM param.

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

As explained in the root cause section.

What alternative solutions did you explore? (Optional)

n/a

Screenshot 2024-03-12 at 22 29 47

@brandonhenry
Copy link
Contributor

brandonhenry commented Mar 12, 2024

Proposal

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

The problem is that the user is unable to share logs to their own self DM from the "Debug console".

What is the root cause of that problem?

The root cause is that in the getShareLogOptions function, we are not including the user's own DM as a valid option to share logs to. This is because:

  1. We are not passing includeSelfDM: true to the getOptions function call to indicate that the user's own DM should be included.

  2. In the getOptions function, we are specifically excluding the user's own DM by adding it to the optionsToExclude array if the includeSelfDM flag is not set.

So in the getShareLogOptions use case, we need to both pass the includeSelfDM flag and avoid adding the user's own DM to optionsToExclude.

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

To solve this, we should make two key changes in OptionsListUtils.ts:

  1. In the getShareLogOptions function, pass includeSelfDM: true in the options object to the getOptions call:
function getShareLogOptions(reports: OnyxCollection<Report>, personalDetails: OnyxEntry<PersonalDetailsList>, searchValue = '', betas: Beta[] = []): GetOptions {
    return getOptions(reports, personalDetails, {
        betas,
        searchInputValue: searchValue.trim(),
        includeRecentReports: true, 
        includeMultipleParticipantReports: true,
        sortByReportTypeInSearch: true,
        includePersonalDetails: true,
        forcePolicyNamePreview: true,
        includeOwnedWorkspaceChats: true,
        includeSelfDM: true, // Add this line
    });
}
  1. In the getOptions function, add a condition to avoid adding the user's own DM to optionsToExclude if includeSelfDM is true:
const optionsToExclude: Option[] = [{login: CONST.EMAIL.NOTIFICATIONS}];

if (!(includeSelfDM && currentUserLogin)) {
    optionsToExclude.push({login: currentUserLogin});
}

What alternative solutions did you explore?

I considered an alternative of always including the user's DM and not having the includeSelfDM flag at all. However, this could lead to the user's DM showing up in other option lists where it may not be appropriate. By keeping the includeSelfDM flag and just passing it when needed for log sharing, we keep the inclusion of the user's DM scoped to only that specific use case and avoid regressions by checking for that variable before specifically removing login: currentUserLogin from optionsToExclude

@allgandalf
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

Currently by default we don't include currentUserLogin details while showing search results in the main getOptions function:

const optionsToExclude: Option[] = [{login: currentUserLogin}, {login: CONST.EMAIL.NOTIFICATIONS}];

This in turn doesn't allow us to show current user details

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

Add option includeSelfDM: true in getShareLogOptions, then update the optionsToExclude condition to:

const optionsToExclude: Option[] = includeSelfDM ? [{ login: CONST.EMAIL.NOTIFICATIONS }] : [{ login: currentUserLogin }, { login: CONST.EMAIL.NOTIFICATIONS }];

The above changes will check the value of includeSelfDM , and will add currentuserLogin to exclude list if includeSelfDM is set to false

We should not remove optionsToExclude, neither should we remove login: currentUserLogin both of these will cause regression as we use getOptions at bunch of places and we don't want to break the basic behavior

What alternative solutions did you explore? (Optional)

N/A

@brandonhenry
Copy link
Contributor

my logic looks a little odd, but just want to clarify that my proposal is not saying get rid of login: currentUserLogin. my proposal includes that in optionsToExclude every time, unless you pass in includeSelfDM

@CortneyOfstad
Copy link
Contributor

@mkhutornyi thoughts on the proposals above? If you can provide any feedback by EOD, that would be great!

@abzokhattab
Copy link
Contributor

abzokhattab commented Mar 14, 2024

I believe enabling the option to send logs to threads as well, would be beneficial. since the user might want to organize the logs in a single thread instead of cluttering the main chat.

what do you think @CortneyOfstad ?

@CortneyOfstad
Copy link
Contributor

I believe enabling the option to send logs to threads as well, would be beneficial. since the user might want to organize the logs in a single thread instead of cluttering the main chat.

I LOVE this idea. I think it makes it much cleaner from a user perspective as well, helping to keep the chat organized without having giant blocks of texts. Great suggestion @abzokhattab!

@mkhutornyi Would love to get your input on this as well!

@mkhutornyi
Copy link
Contributor

yes agree but before doing that, I'd like to ask author who implmeneted this feature if it was intentional. There might have been context/discussion for this.

@allgandalf
Copy link
Contributor

There might be deleted threads in the search results as well, and hence they might have disabled the threads option 🤔

@abzokhattab
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label Mar 18, 2024
@CortneyOfstad
Copy link
Contributor

Continuing to wait on a response from Vivek and Tomaz and the question here. If we don't hear anything by EOD, going to bump 👍

@melvin-bot melvin-bot bot removed the Overdue label Mar 18, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 25, 2024
@abzokhattab
Copy link
Contributor

The PR is ready!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Not able to share logs to own self DM from "Debug console" [HOLD for payment 2024-04-05] [$500] Not able to share logs to own self DM from "Debug console" Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊

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

  • @abzokhattab requires payment (Needs manual offer from BZ)
  • @mkhutornyi requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 29, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@bondydaa] The PR that introduced the bug has been identified. Link to the PR:
  • [@bondydaa] 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:
  • [@bondydaa] A discussion in #expensify-bugs 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:
  • [@abzokhattab / @mkhutornyi] Determine if we should create a regression test for this bug.
  • [@abzokhattab / @mkhutornyi] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@CortneyOfstad
Copy link
Contributor

@abzokhattab sent you an offer here
@mkhutornyi sent you an offer here

Please let me know once you both accept.

Also @mkhutornyi please have the checklist above completed by EOD today — thanks!

@abzokhattab
Copy link
Contributor

Thank you! Just accepted the offer

Copy link

melvin-bot bot commented Apr 5, 2024

Payment Summary

Upwork Job

BugZero Checklist (@CortneyOfstad)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1767616215332700160/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@CortneyOfstad
Copy link
Contributor

@mkhutornyi looks like you haven't accepted the offer yet. Can you do that when you have a chance and let me know here? Thanks!

@CortneyOfstad
Copy link
Contributor

Bump @mkhutornyi ^^^

@CortneyOfstad
Copy link
Contributor

It shows that @mkhutornyi is out sick, so going to keep this open until they are back 👍

@CortneyOfstad
Copy link
Contributor

According to Slack @mkhutornyi is still sick, so continuing to keep this open 👍

@melvin-bot melvin-bot bot added the Overdue label Apr 23, 2024
@CortneyOfstad
Copy link
Contributor

@mkhutornyi — just checking to see if you're back? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2024
@CortneyOfstad
Copy link
Contributor

@mkhutornyi going to close this, feel free to reopen when you're back — hope all is well!

@mallenexpensify
Copy link
Contributor

@mkhutornyi is back! can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~019b60b595b681eb92

@CortneyOfstad can you finish off payment once it's ready?

@CortneyOfstad
Copy link
Contributor

Welcome back @mkhutornyi!

@mkhutornyi
Copy link
Contributor

Accepted offer. Thanks

@CortneyOfstad
Copy link
Contributor

Payment Summary

@mkhutornyi — paid $500 via Upwork
@abzokhattab — paid $500 via Upwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

9 participants