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: add missing property 'silent' to MessageBase type #1154

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

MartinCupela
Copy link
Contributor

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

Description of the changes, What, Why and How?

According to the JS SDK documentation, the Message object passed as the first argument to Channel.sendMessage() method should optionally carry silent property. This property was however not declared in the type definition. This PR adds the property to the underlying MessageBase type definition.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2023

Size Change: 0 B

Total Size: 318 kB

ℹ️ View Unchanged
Filename Size
dist/browser.es.js 69.5 kB
dist/browser.full-bundle.min.js 37.6 kB
dist/browser.js 70.5 kB
dist/index.es.js 69.6 kB
dist/index.js 70.6 kB

compressed-size-action

@rchl
Copy link

rchl commented Aug 14, 2023

When adding it to MessageBase it should be possible to remove it from MessageResponseBase since the latter extends the former -

stream-chat-js/src/types.ts

Lines 519 to 547 in 31da90b

export type MessageResponseBase<
StreamChatGenerics extends ExtendableGenerics = DefaultGenerics
> = MessageBase<StreamChatGenerics> & {
type: MessageLabel;
args?: string;
channel?: ChannelResponse<StreamChatGenerics>;
cid?: string;
command?: string;
command_info?: { name?: string };
created_at?: string;
deleted_at?: string;
i18n?: RequireAtLeastOne<Record<`${TranslationLanguages}_text`, string>> & {
language: TranslationLanguages;
};
latest_reactions?: ReactionResponse<StreamChatGenerics>[];
mentioned_users?: UserResponse<StreamChatGenerics>[];
own_reactions?: ReactionResponse<StreamChatGenerics>[] | null;
pin_expires?: string | null;
pinned_at?: string | null;
pinned_by?: UserResponse<StreamChatGenerics> | null;
reaction_counts?: { [key: string]: number } | null;
reaction_scores?: { [key: string]: number } | null;
reply_count?: number;
shadowed?: boolean;
silent?: boolean;
status?: string;
thread_participants?: UserResponse<StreamChatGenerics>[];
updated_at?: string;
};

szuperaz
szuperaz previously approved these changes Aug 14, 2023
oliverlaz
oliverlaz previously approved these changes Aug 14, 2023
@MartinCupela MartinCupela merged commit ba30397 into master Aug 21, 2023
6 checks passed
@MartinCupela MartinCupela deleted the fix/add-silent-prop-to-messagebase branch August 21, 2023 09:50
This was referenced Aug 21, 2023
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.

5 participants