stream-chat 10.0.0-rc.25 → 10.0.0-rc.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.browser.js +29 -18
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +29 -18
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +29 -18
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/connection/wsConnection/StableWSConnection.d.ts +2 -2
- package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +7 -0
- package/package.json +1 -1
- package/src/connection/wsConnection/StableWSConnection.ts +2 -2
- package/src/messageComposer/middleware/messageComposer/customData.ts +5 -5
- package/src/messageDelivery/MessageReceiptsTracker.ts +1 -1
- package/src/messageOperations/MessageOperations.ts +14 -9
- package/src/notifications/NotificationManager.ts +1 -1
- package/src/pagination/paginators/MessageIntervalPaginator.ts +17 -3
|
@@ -3548,16 +3548,16 @@ var createCustomDataCompositionMiddleware = (composer) => ({
|
|
|
3548
3548
|
forward
|
|
3549
3549
|
}) => {
|
|
3550
3550
|
const data = composer.customDataManager.customMessageData;
|
|
3551
|
-
if (!data) return forward();
|
|
3551
|
+
if (!data || !Object.keys(data).length) return forward();
|
|
3552
3552
|
return next({
|
|
3553
3553
|
...state,
|
|
3554
3554
|
localMessage: {
|
|
3555
3555
|
...state.localMessage,
|
|
3556
|
-
...data
|
|
3556
|
+
custom: { ...state.localMessage.custom, ...data }
|
|
3557
3557
|
},
|
|
3558
3558
|
message: {
|
|
3559
3559
|
...state.message,
|
|
3560
|
-
...data
|
|
3560
|
+
custom: { ...state.message.custom, ...data }
|
|
3561
3561
|
}
|
|
3562
3562
|
});
|
|
3563
3563
|
}
|
|
@@ -3572,12 +3572,12 @@ var createDraftCustomDataCompositionMiddleware = (composer) => ({
|
|
|
3572
3572
|
forward
|
|
3573
3573
|
}) => {
|
|
3574
3574
|
const data = composer.customDataManager.customMessageData;
|
|
3575
|
-
if (!data) return forward();
|
|
3575
|
+
if (!data || !Object.keys(data).length) return forward();
|
|
3576
3576
|
return next({
|
|
3577
3577
|
...state,
|
|
3578
3578
|
draft: {
|
|
3579
3579
|
...state.draft,
|
|
3580
|
-
...data
|
|
3580
|
+
custom: { ...state.draft.custom, ...data }
|
|
3581
3581
|
}
|
|
3582
3582
|
});
|
|
3583
3583
|
}
|
|
@@ -8069,7 +8069,7 @@ var MessageIntervalPaginator = class extends BasePaginator {
|
|
|
8069
8069
|
if (this.parentMessageId) {
|
|
8070
8070
|
const repliesResponse = await this.channel.getClient().getReplies(
|
|
8071
8071
|
{ parent_id: this.parentMessageId },
|
|
8072
|
-
{ ...options, sort: this.
|
|
8072
|
+
{ ...options, sort: this.getRepliesRequestSort(options) }
|
|
8073
8073
|
);
|
|
8074
8074
|
return { repliesResponse, source: "replies" };
|
|
8075
8075
|
}
|
|
@@ -9350,7 +9350,8 @@ var MessageIntervalPaginator = class extends BasePaginator {
|
|
|
9350
9350
|
if (fallback) {
|
|
9351
9351
|
this.setActiveInterval(fallback);
|
|
9352
9352
|
} else {
|
|
9353
|
-
this.
|
|
9353
|
+
this.setActiveInterval(void 0);
|
|
9354
|
+
this.state.partialNext({ items: [], hasMoreTail: false });
|
|
9354
9355
|
}
|
|
9355
9356
|
}
|
|
9356
9357
|
/**
|
|
@@ -9395,6 +9396,16 @@ var MessageIntervalPaginator = class extends BasePaginator {
|
|
|
9395
9396
|
filterQueryResults(items) {
|
|
9396
9397
|
return items.filter(this.shouldIncludeMessageInInterval.bind(this));
|
|
9397
9398
|
}
|
|
9399
|
+
/**
|
|
9400
|
+
* The sort of a replies request. A page newer than a cursor (`id_gt`, `created_at_after`, ...)
|
|
9401
|
+
* must hold the replies right after the cursor, so it is requested oldest first: newest first
|
|
9402
|
+
* returns the newest replies and skips the ones in between. The page is put in item order
|
|
9403
|
+
* afterwards, so the request sort only decides which replies the page holds.
|
|
9404
|
+
*/
|
|
9405
|
+
getRepliesRequestSort(options) {
|
|
9406
|
+
if (getLinearQueryDirection(options) !== "headward") return this.requestSort;
|
|
9407
|
+
return this.requestSort.map((sort) => ({ ...sort, direction: 1 }));
|
|
9408
|
+
}
|
|
9398
9409
|
getCanonicalQueryItems(items) {
|
|
9399
9410
|
return [...items].sort(this.itemOrderComparator);
|
|
9400
9411
|
}
|
|
@@ -14343,7 +14354,7 @@ var MessageReceiptsTracker = class extends WithSubscriptions {
|
|
|
14343
14354
|
* cursor says nothing about whether anyone received the message.
|
|
14344
14355
|
*/
|
|
14345
14356
|
furthestRefByOthers(sorted, refOf) {
|
|
14346
|
-
const ownUserId = this.channel.getClient().
|
|
14357
|
+
const ownUserId = this.channel.getClient().userId;
|
|
14347
14358
|
for (let i = sorted.length - 1; i >= 0; i -= 1) {
|
|
14348
14359
|
if (sorted[i].user.id === ownUserId) continue;
|
|
14349
14360
|
const ref = refOf(sorted[i]);
|
|
@@ -14649,6 +14660,14 @@ var DEFAULT_MESSAGE_OPERATIONS_CONFIG = deepFreezeConfig({
|
|
|
14649
14660
|
failedSendCacheMaxSize: 100,
|
|
14650
14661
|
failedSendCacheTtlMs: 5 * 60 * 1e3
|
|
14651
14662
|
});
|
|
14663
|
+
var pickUpdateOptions = (options) => {
|
|
14664
|
+
if (!options) return void 0;
|
|
14665
|
+
const picked = {};
|
|
14666
|
+
if (typeof options.skip_enrich_url === "boolean")
|
|
14667
|
+
picked.skip_enrich_url = options.skip_enrich_url;
|
|
14668
|
+
if (typeof options.skip_push === "boolean") picked.skip_push = options.skip_push;
|
|
14669
|
+
return picked;
|
|
14670
|
+
};
|
|
14652
14671
|
var MessageOperations = class {
|
|
14653
14672
|
constructor(ctx) {
|
|
14654
14673
|
this.failedSendCache = new FailedSendCache(() => this.config);
|
|
@@ -14811,20 +14830,12 @@ var MessageOperations = class {
|
|
|
14811
14830
|
async update(params) {
|
|
14812
14831
|
this.failedSendCache.rewriteWithEdit(params.localMessage);
|
|
14813
14832
|
const handlers = this.ctx.handlers();
|
|
14814
|
-
let updateOptions;
|
|
14815
|
-
if (params.options) {
|
|
14816
|
-
updateOptions = {};
|
|
14817
|
-
if (typeof params.options.skip_enrich_url === "boolean")
|
|
14818
|
-
updateOptions.skip_enrich_url = params.options.skip_enrich_url;
|
|
14819
|
-
if (typeof params.options.skip_push === "boolean")
|
|
14820
|
-
updateOptions.skip_push = params.options.skip_push;
|
|
14821
|
-
}
|
|
14822
14833
|
return await this.run(
|
|
14823
14834
|
"update",
|
|
14824
14835
|
params,
|
|
14825
14836
|
this.resolveRequest(
|
|
14826
14837
|
handlers.update,
|
|
14827
|
-
async (p) => await this.ctx.defaults.update(p.localMessage,
|
|
14838
|
+
async (p) => await this.ctx.defaults.update(p.localMessage, pickUpdateOptions(p.options))
|
|
14828
14839
|
)
|
|
14829
14840
|
);
|
|
14830
14841
|
}
|
|
@@ -24856,7 +24867,7 @@ var StreamChat = class _StreamChat extends ChatApi {
|
|
|
24856
24867
|
return this.userAgent;
|
|
24857
24868
|
}
|
|
24858
24869
|
if (!this.cachedUserAgent) {
|
|
24859
|
-
const version = "10.0.0-rc.
|
|
24870
|
+
const version = "10.0.0-rc.26";
|
|
24860
24871
|
const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
|
|
24861
24872
|
const { name: appName, version: appVersion } = this.appIdentifier ?? {};
|
|
24862
24873
|
const { os, model: deviceModel } = this.deviceIdentifier ?? {};
|