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

Channels shown multiple times #940

Closed
philippeauriach opened this issue Oct 19, 2021 · 16 comments
Closed

Channels shown multiple times #940

philippeauriach opened this issue Oct 19, 2021 · 16 comments
Assignees

Comments

@philippeauriach
Copy link

philippeauriach commented Oct 19, 2021

Describe the bug
A single channel is shown multiple times.

<ChannelList/> is shown only when the user is connected to GetStream, the following way :

          <ChannelList
            filters={_filters}
            options={options}
            lockChannelOrder
            LoadingIndicator={LoadingScreen}
            Preview={ChannelItem}
            loadMoreThreshold={0.9}
            HeaderNetworkDownIndicator={NullComponent}
            EmptyStateIndicator={NullComponent}
          />

_filters is the result of a useMemo, updated when we change the filters. Basically it is just {type: 'messaging', members: {$in: [userIdentifier]}}
options is static = { limit: 30 }
ChannelItem is a home made component following the documentation (consuming the channel object and returning a memoized component to display channels)

We regularly have an issue where a single channel is displayed multiple times. I'm having trouble reproducing it in dev (it happens on an end user account, I can provide a video showing the problem).
Any tips that could explain this ? We previously had a similar problem, caused by the sort option, that we removed on advice from the GetStream team and it improved the situation by a lot.

Dev environment info (please complete/provide the following information):

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.
We have a server side job that sync users with conversations (to update conversation data), not sure if this could cause a problem? Should not?

Screenshots
If applicable, add screenshots to help explain your problem.

gz#15977

@madsroskar
Copy link
Contributor

Hi @philippeauriach, thanks for reaching out. I don't immediately know of tips, but I'll set up an app with the same version of the dependencies and test it out to try to reproduce the issue on my end.

We have a server side job that sync users with conversations (to update conversation data), not sure if this could cause a problem?

I'm not sure I understand what's being synced in this case. Are you updating the channels with custom data? If so, it doesn't sound like it would cause the issue, but it's worth looking into - thanks! :)

Otherwise, would you be able to explain a bit more what the sync does?

Thank you again,
Mads

@philippeauriach
Copy link
Author

Hi @madsroskar , thanks for the help.
I tried reproducting it in dev and did not achieve ^^ I can send a video showing the problem (but in private as it shows user names).

Our server job takes a list of users (around 150), and for each of those users, create (or update, but use the create method of channels), and then update using updatePartial :

const channel = serverClient.channel('messaging', {created_by_id: 'philippeauriach', members: [u.identifier, u.targetIdentifier]});
await channel.create();
const {tagA, tagB} = computeTags(u);
await channel.updatePartial({
  set: {tag_a: tagA, tag_b: tagB},
});

@madsroskar
Copy link
Contributor

madsroskar commented Oct 19, 2021

but in private

You could send it directly to me via email at [[edit: removed personal email for now]] or to our support email at [email protected] if that would work for you? 🙂

Thanks a lot for adding the snippet, that helps a lot!

@philippeauriach
Copy link
Author

Video sent to your email, with additional info about the app purpose and how it works! thanks again

@philippeauriach
Copy link
Author

To add to the "context", it seems that it happens when this user sends multiple messages to multiple channels (each morning) in a relatively short amount of time, and only one channel is deduplicated when scrolling

@madsroskar
Copy link
Contributor

Thanks for the added information, I'll try it out to see if it helps to reproduce the issue. :)

@philippeauriach
Copy link
Author

Hello @madsroskar , we made a test without the design customization (we are using the ChannelPreview prop), and it seems to not have the issue. We'll try adding components again one by one using more granular prop to overwrite designs and see if it's better.

@jehartzog
Copy link

We are seeing this issue also exactly the same as @philippeauriach describes. It is a rare reproduction, maybe once every 100 sessions. It often self resolves when the app is hard-killed and restarted. We could not find any way to reproduce it yet. If somebody finds the answer, we'd be happy to help test the solution and see if we can go a few weeks without any more reports of this.

@vishalnarkhede
Copy link
Contributor

@jehartzog what sort prop have you set on ChannelList component?

@jehartzog
Copy link

@vishalnarkhede const sort: ChannelSortBase = {last_message_at: -1};

@vishalnarkhede
Copy link
Contributor

Hey @jehartzog please take a look at this. It should solve the issue - #901 (comment)

@jehartzog
Copy link

@vishalnarkhede Thank you for the pointer. We have made the code change (removing the sort prop since we use default anyway). Since we saw this issue very rarely in our app and we don't have a reliable reproduction, we won't be able to confirm that this clears it anytime soon, but we'll throw a note back here if we happen to see it again.

@madsroskar
Copy link
Contributor

Hi @jehartzog - just wondering if you have noticed this reoccurring yet?

@jehartzog
Copy link

@madsroskar I've left the project and wouldn't be a good source to answer the question. @lucaswhitman would know better if the issue has reoccurred since this change.

@lucaswhitman
Copy link

@madsroskar I haven't had any reports, but they were few and far between in the first place so it's hard to say for sure.

@vishalnarkhede
Copy link
Contributor

I am going to close this issue for now.

On side note, we have published our next major version of RN Chat SDK - v4.1.0 🎉.

This release includes plenty of improvements and fixes. Please take a look at Release Notes for details.

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

No branches or pull requests

5 participants