App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2022-01-25] Rooms are duplicated in results list when searching the room by name - @Kidroca

Open isagoico opened this issue 5 years ago • 38 comments

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. In a account that has at least 1 workspace
  2. Open search
  3. Search for #announce room
  4. Delete a character and write it again

Expected Result:

After triggering the search, there's no duplicates in the results list.

Actual Result:

After triggering the search several times there's a bunch of duplicates in the results list.

Workaround:

None needed, visual issue.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.1.6-0

Reproducible in staging?: yes Reproducible in production?: yes

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

Notes/Photos/Videos: Any additional supporting documentation

image

https://user-images.githubusercontent.com/44479856/136270342-39e7bdb0-71a5-4e26-af58-fc7698136a5b.mp4

Expensify/Expensify Issue URL: Upwork Job: https://www.upwork.com/jobs/~018be34f339157da58

Issue reported by: @kidroca Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1633507668430400

View all open jobs on GitHub

isagoico avatar Oct 06 '21 19:10 isagoico

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

MelvinBot avatar Oct 06 '21 19:10 MelvinBot

@kidroca can you check if you have multiple announce named reports in localhost. In my case, I have multiple reports with announce name.

parasharrajat avatar Oct 08 '21 15:10 parasharrajat

Triggered auto assignment to @kevinksullivan (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Oct 08 '21 20:10 MelvinBot

@kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

MelvinBot avatar Oct 12 '21 19:10 MelvinBot

I am also seeing duplicates and can reproduce the issue.

image

kevinksullivan avatar Oct 16 '21 15:10 kevinksullivan

https://www.upwork.com/jobs/~018be34f339157da58

kevinksullivan avatar Oct 16 '21 15:10 kevinksullivan

This issue has not been updated in over 15 days. eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

MelvinBot avatar Nov 08 '21 19:11 MelvinBot

It seems to be lost. I think I know why this is happening. so let's fix it.

Proposal

  1. We have to divide the existing https://github.com/Expensify/App/blob/c2b96c1042e8055bf8e6c689b5a358245184b5d4/src/pages/SearchPage.js#L93 into two. like
   const sections = [{
            title: this.props.translate('common.recents'),
            data: this.state.recentReports,
            shouldShow: true,
            indexOffset: 0,
        },
        {
            title: this.props.translate('common.contacts'),
            data: this.state.personalDetails,
            shouldShow: true,
            indexOffset: this.state.recentReports.length,
        }];

It fixes it.

@kevinksullivan Could you please reapply the exported label?

parasharrajat avatar Dec 01 '21 14:12 parasharrajat

Looks like https://www.upwork.com/jobs/~018be34f339157da58 is closed now, going to re-apply the Engineering label to get a proposal reviewer and the External label to get somebody to export this

Jag96 avatar Dec 01 '21 20:12 Jag96

Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Dec 01 '21 20:12 MelvinBot

@parasharrajat can you explain why that proposal fixes the issue, and why the issue is happening?

Jag96 avatar Dec 01 '21 20:12 Jag96

New job post: https://www.upwork.com/jobs/~014d2f47f2ea404f3b

NicMendonca avatar Dec 01 '21 21:12 NicMendonca

Triggered auto assignment to @parasharrajat (Exported)

MelvinBot avatar Dec 01 '21 21:12 MelvinBot

Current assignee @Jag96 is eligible for the Exported assigner, not assigning anyone new.

MelvinBot avatar Dec 01 '21 21:12 MelvinBot

OK, so these are the details.

  1. First I think getOptions in OptionListUtils.js has a bug.
  2. Bug is that the personalDetails array from getOptions has a room.
  3. I saw that one of the room data has one participant. But it shouldn't have any participants looking into other rooms.
  4. Now when we parse the personalDetails, one of the user's personal details is swapped by the above room. (participant email is matched).
  5. When we search, we filter the reports that are present in recent reports from the personalDetailsOptions (By matching the emails).
  6. in Step 4, one of the participant items in personalDetailsOptions contains room information ( login key is null here). Thus the filter fails for step 5.
  7. Thus in a room is left in the personalDetails.

Now It is somehow being appended into the data list of the sections of the FlatList.

it looks like doing the above logic fixes it (It feels like a hack) and Actually, the code should be refactored as I suggested above even though it does not fix the main cause.

I did this debugging when you asked but initially above-posted proposal fixed it in the first attempt so I thought there might be something wrong with that code.

parasharrajat avatar Dec 01 '21 21:12 parasharrajat

Good find, so it sounds like first we need to confirm that 2 is a bug and there isn't any reason for that (I'm not sure), asking in slack should help get more info on it. If it is a bug, I agree we should fix that issue first.

it looks like doing the above logic fixes it (It feels like a hack) and Actually, the code should be refactored as I suggested above even though it does not fix the main cause.

Agreed 👍

Jag96 avatar Dec 02 '21 20:12 Jag96

@Jag96 Any luck in finding the reason.

parasharrajat avatar Dec 08 '21 16:12 parasharrajat

Ah, I was suggesting that you should dig into that part of your proposal to confirm the issue you believe is a bug is in fact a bug, and that asking in slack would probably be the easiest way to get that info.

Jag96 avatar Dec 08 '21 19:12 Jag96

First, due to point 2, A contact is skipped from the search whose login matches with the duplicated room's only participant. Room's info overwrites it.

parasharrajat avatar Dec 08 '21 19:12 parasharrajat

As an update, there's a discussion happening in https://github.com/Expensify/App/issues/6627#issuecomment-992846498, the fix for that should fix this as well

Jag96 avatar Dec 16 '21 01:12 Jag96