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

fix(search): missing thread_participants in message #1412

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/channel.ts
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ import {
AscDesc,
PartialUpdateMemberAPIResponse,
AIState,
MessageOptions,
} from './types';
import { Role } from './permissions';
import { DEFAULT_QUERY_CHANNEL_MESSAGE_LIST_PAGE_SIZE } from './constants';
@@ -237,6 +238,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
client_id?: string;
connection_id?: string;
message_filter_conditions?: MessageFilters<StreamChatGenerics>;
message_options?: MessageOptions;
query?: string;
} = {},
) {
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1713,6 +1713,10 @@ export type MessageFilters<StreamChatGenerics extends ExtendableGenerics = Defau
}
>;

export type MessageOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that only MessageOptions would not be clear enough to convey the fact that these are actually search payload options.

Suggested change
export type MessageOptions = {
export type SearchMessageOptions = {

Copy link
Contributor Author

@kanat kanat Dec 11, 2024

Choose a reason for hiding this comment

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

Yeah I thought about it as well, however, technically, in the future, it could be used in other places where the MessageFilters is also used.

include_thread_participants?: boolean;
};

export type PrimitiveFilter<ObjectType> = ObjectType | null;

export type QueryFilter<ObjectType = string> = NonNullable<ObjectType> extends string | number | boolean
@@ -2738,6 +2742,7 @@ export type SearchPayload<StreamChatGenerics extends ExtendableGenerics = Defaul
connection_id?: string;
filter_conditions?: ChannelFilters<StreamChatGenerics>;
message_filter_conditions?: MessageFilters<StreamChatGenerics>;
message_options?: MessageOptions;
query?: string;
sort?: Array<{
direction: AscDesc;