Skip to content

Commit d5e4802

Browse files
Drop serverside instantiation options
1 parent 3ebe3bf commit d5e4802

4 files changed

Lines changed: 7 additions & 52 deletions

File tree

src/channel.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,23 +1196,12 @@ export class Channel extends ChannelApi {
11961196
* @returns A query response.
11971197
*/
11981198
async query(
1199-
options: ChannelQueryOptions & { created_by_id?: string } = {},
1199+
options: ChannelQueryOptions = {},
12001200
messageSetToAddToIfDoesNotExist: MessageSetType = 'current',
12011201
) {
12021202
// Make sure we wait for the connect promise if there is a pending one
12031203
await this.getClient().wsPromise;
12041204

1205-
const createdById = options.created_by_id ?? this._data?.created_by?.id;
1206-
// this._data?.created_by_id;
1207-
1208-
if (this.getClient()._isUsingServerAuth() && typeof createdById !== 'string') {
1209-
logger
1210-
.withExtraTags('query', this.cid)
1211-
.warn(
1212-
'Neither `created_by` (with an `id` property) nor `created_by_id` is set on `Channel._data` or the `options` parameter.',
1213-
);
1214-
}
1215-
12161205
const queryPayload: Gen_ChannelGetOrCreateRequest = {
12171206
data: this._data,
12181207
state: true,
@@ -1876,7 +1865,11 @@ export class Channel extends ChannelApi {
18761865
if (event.message && event.reaction) {
18771866
const { message, reaction } = event;
18781867
// assuming reaction.updated is only called if enforce_unique is true
1879-
event.message = channelState.addReaction(reaction, message, true);
1868+
event.message = channelState.addReaction(
1869+
reaction,
1870+
message,
1871+
true,
1872+
) as MessageResponse;
18801873
}
18811874
break;
18821875
case 'channel.hidden':
@@ -1951,11 +1944,7 @@ export class Channel extends ChannelApi {
19511944
};
19521945

19531946
_checkInitialized() {
1954-
if (
1955-
!this.initialized &&
1956-
!this.offlineMode &&
1957-
!this.getClient()._isUsingServerAuth()
1958-
) {
1947+
if (!this.initialized && !this.offlineMode) {
19591948
throw Error(
19601949
`Channel ${this.cid} hasn't been initialized yet. Make sure to call .watch() and wait for it to resolve`,
19611950
);

src/channel_state.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,6 @@ export class ChannelState {
350350
this.pinnedMessages = result;
351351
}
352352

353-
addReaction(
354-
reaction: ReactionResponse,
355-
message: MessageResponse,
356-
enforce_unique?: boolean,
357-
): MessageResponse;
358-
addReaction(
359-
reaction: ReactionResponse,
360-
message?: undefined,
361-
enforce_unique?: boolean,
362-
): LocalMessage | undefined;
363353
addReaction(
364354
reaction: ReactionResponse,
365355
message?: MessageResponse,
@@ -516,11 +506,6 @@ export class ChannelState {
516506
return [];
517507
}
518508

519-
removeReaction(reaction: ReactionResponse, message: MessageResponse): MessageResponse;
520-
removeReaction(
521-
reaction: ReactionResponse,
522-
message?: undefined,
523-
): LocalMessage | undefined;
524509
removeReaction(
525510
reaction: ReactionResponse,
526511
message?: MessageResponse,

src/client.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,6 @@ export class StreamChat extends ChatApi {
282282
...options,
283283
};
284284

285-
chatLoggerSystem.configureLoggers({
286-
...options.logOptions,
287-
default: {
288-
level: options.logLevel ?? 'info',
289-
...options.logOptions?.default,
290-
},
291-
});
292-
293285
this.axiosInstance = axios.create({
294286
timeout: 3000,
295287
withCredentials: false,

src/types.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -855,17 +855,6 @@ export type StreamChatOptions = {
855855
enableInsights?: boolean;
856856
/** experimental feature, please contact support if you want this feature enabled for you */
857857
enableWSFallback?: boolean;
858-
/**
859-
* Minimum log level forwarded to the default sink. Accepts `'trace' | 'debug' | 'info' | 'warn' | 'error'`.
860-
* Defaults to `'info'`.
861-
*/
862-
logLevel?: LogLevel;
863-
/**
864-
* Per-scope sink and level overrides applied to `chatLoggerSystem` at construction time.
865-
* Use this to redirect output (e.g. to Sentry) or to crank a single subsystem to `'debug'`
866-
* without touching the others.
867-
*/
868-
logOptions?: ConfigureLoggersOptions<ChatLoggerScope>;
869858
/**
870859
* Custom notification manager service to use for the client.
871860
* If not provided, a default notification manager will be created.

0 commit comments

Comments
 (0)