Skip to content

Web - Unable to search room after it has been created #6726

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

Closed
kbecciv opened this issue Dec 13, 2021 · 18 comments
Closed

Web - Unable to search room after it has been created #6726

kbecciv opened this issue Dec 13, 2021 · 18 comments
Assignees
Labels
Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Dec 13, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Go to https://staging.new.expensify.com
  2. Log in with expensifail account
  3. Click on Plus button and Click on New Room
  4. On Room name type any name
  5. On Workspace select any Workspace
  6. Click Create Room
  7. After room created type something
  8. Go to search box and type the room name which you just created.

Expected Result:

We are able to search for this room using its title.

Actual Result:

Room does not show as an option when we search for it.

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Web

Version Number: 1.1.20-0

Reproducible in staging?: Yes
Reproducible in production?: No

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Video

Expensify/Expensify Issue URL:

Issue reported by: Manan Jadhav & Applause

Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1639336320144000

View all open jobs on GitHub

@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Dec 13, 2021
@OSBotify
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.

@MelvinBot
Copy link

Triggered auto assignment to @NikkiWines (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@mountiny
Copy link
Contributor

I have added two more lines to the PR I already raised to fix other two blockers related to this component to fix this issue as well.

@mountiny
Copy link
Contributor

Actually, just noticed that this has also the and unable to search part, which is not solved in that PR, the linked PR only makes sure the tile name is shown, but one still cannot really search and find the room once you click away from it.

I will split this into two issues then.

@mountiny mountiny changed the title Web - Room name doesn't display in the header after creating and unable to search Web - Unable to search room after it has been created Dec 13, 2021
@mountiny mountiny removed the Reviewing Has a PR in review label Dec 13, 2021
@mountiny mountiny removed their assignment Dec 13, 2021
@mountiny
Copy link
Contributor

Alright, so I have updated this issue to be only about the inability to search the room after creating it and created separate deploy locker for the room name here as their solutions are not completely connected and it would be better to have a separate PR to solve this as the PR mentioned above is already covering 3 issues (better for testing and granularity).

@mountiny
Copy link
Contributor

Actually, we have found out that this is being worked on by @TomatoToaster. Since the policy rooms are still in beta, full functionality is not required. Internal issue here

@TomatoToaster TomatoToaster added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 13, 2021
@TomatoToaster
Copy link
Contributor

Ok I figured out the source of this problem. When we're creating these policyRooms, somehow they are not being added to the sharedReports table. Typically with chatReports (including defaultRooms), the report has an accountID of 0 and all the members are included in the sharedReports table.

What's happening right now is that the policyRooms have the owner on the report but the report is not shared with them. Here's an example of a policy room, which has no entries in shared reports and a non-zero accountID:

sqlite> select * from reports where reportID = 11179;
   created = 2021-12-13 20:26:33
 submitted =
  approved =
  reportID = 11179
 accountID = 867
 managerID =
reportName = #test_one_more
     state = 0
     total = 0
  currency = USD
cachedData =
    status = 0


sqlite> select * from sharedReports where reportID = 11172;
  accountID = 185
   reportID = 11172
permissions = read, write

  accountID = 867
   reportID = 11172
permissions = read, write

Here's an example of a default chat room with one person in it (#admins room) which organized more correctly:

sqlite> select * from reports where reportID = 11174;
   created = 2021-12-07 20:26:55
 submitted =
  approved =
  reportID = 11174
 accountID = 0
 managerID =
reportName = admins
     state = 0
     total = 0
  currency = USD
cachedData = {"submitted":"","submittedTo":"","approved":"","unapproved":"","reimbursed":"","shared":"","type":"chat","retracted":"","expensify_policyID":"56CD5FB9EB22E916","policyLastModified":1638911442453003,"isSmartReport":false,"cacheComputedBy":867,"inbox":{"violations":[],"policyType":"free","firstSubmittedDate":"","wasComputedInReportCache":true},"reimburserEmail":"__FAKE__","queuedForAutoExport":{"queued":false,"connections":[],"exportFailed":false,"failedConnections":[]},"hasBeenExportedToIntegration":false,"wasReimbursedViaACH":false,"statementCardID":null,"statementPeriodEndDay":null,"isWaitingOnBankAccount":false,"isABAReimbursed":false,"expectedReimbursementDate":null,"canMarkReimbursementReceived":true,"hasReimbursableTotal":false,"hasTransactions":false,"hasBillableTransactions":false,"reportOwners":[],"managerOnVacation":"","isSmartReportOnFile":false,"invoiceID":0,"billID":0}
    status = 0


sqlite> select * from sharedReports where reportID = 11174;
  accountID = 867
   reportID = 11174
permissions = read, write

@TomatoToaster
Copy link
Contributor

You can see from these lines of code:
https://github.com/Expensify/Auth/blob/6fe483924dfa8f4d5356e97cc2fd662e0569b29d/auth/lib/Account.cpp#L2128-L2133

We fetch chat reports that are shared with users NOT chat reports that they own.

@TomatoToaster
Copy link
Contributor

Got a PR for this soon ~ just testing it out locally first.

@TomatoToaster
Copy link
Contributor

Ok so that PR didn't work and herein lies the problem:
https://github.com/Expensify/Auth/blob/c0e21eada76b52827126e2b7d7480cf9ed1032ab/auth/lib/Report.cpp#L402-L406

It seems like we can't really "share" a report with the person who creates it, so maybe we should remove the creator's accountID from the chat report because other chat reports don't tend to have that.

Alternatively we could tweak the fetch chats query to include owned reports, but I think the above solution makes more sense. No other chats seem to be "owned" by users who are in them. This will also allow owners to leave rooms they create if they want to as well.

@TomatoToaster
Copy link
Contributor

I'll work on a CQ to fix this issue for existing chatReports. However, we should run it after the above PR goes into production so that we can capture all chatReports that are made incorrectly in production.

@MelvinBot
Copy link

@TomatoToaster Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MelvinBot
Copy link

@TomatoToaster Eep! 4 days overdue now. Issues have feelings too...

@TomatoToaster
Copy link
Contributor

Oh I didn't notice this was overdue because the PR was already merged! I still need to make the query to fix the existing chats. That's not a super pressing issue though so I'll make this a weekly. Going to finish workspace chat docs first.

@TomatoToaster TomatoToaster added Weekly KSv2 and removed Daily KSv2 labels Dec 23, 2021
@TomatoToaster
Copy link
Contributor

This should be fixed as of this PR for new Workspace Chats

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Third week) Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants