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

feat(conversations): add filter args to conversation list with last message #1470

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

mchenani
Copy link
Contributor

@mchenani mchenani commented Jan 6, 2025

Summary:
In PR #1437, we added a new function to fetch conversations along with their last message. This replaces the old functions with the new query.
Also updated the list_conversations function to support filters.
#1181

@mchenani mchenani requested a review from a team as a code owner January 6, 2025 09:30
.into_boxed();
Ok(self.raw_query(|conn| query.load::<ConversationListItem>(conn))?)

//question: do we need to do this always? if yes, we can put it in the main view query instead of here!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean is this flag always true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if it is, we can embed this in the main query.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be always false in the case of the view that you're building? Typically the query will only get the overlapping DM with the latest message, which I believe is what you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what you're saying I can keep it like this, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to always filter out duplicate DMs. This section of code will filter out duplicates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep it like these to give the control to the sdk and the integrators.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So just for clarity by default the duplicate dms are filtered out correct? Or will it be required to do it on my end?

@mchenani mchenani merged commit 821c912 into main Jan 6, 2025
11 checks passed
@mchenani mchenani deleted the mc/return-last-message-in-all-conversation-lists branch January 6, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants