stream-chat 10.0.0 → 10.0.1

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.
@@ -220,7 +220,9 @@ export declare class MessagePaginator extends MessageIntervalPaginator {
220
220
  /**
221
221
  * A message the paginator does not hold yet, at or after {@link latestMessageAt} (as known before
222
222
  * it arrives), while no loaded interval reaches the newest message. It is then the newest message,
223
- * so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}).
223
+ * so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}). In a
224
+ * channel whose newest page was loaded empty, with no newest message time known, any message is
225
+ * the newest.
224
226
  */
225
227
  private isNewNewestMessage;
226
228
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "JS SDK for the Stream Chat API",
5
5
  "homepage": "https://getstream.io/chat/",
6
6
  "author": {
@@ -411,13 +411,18 @@ export class MessagePaginator extends MessageIntervalPaginator {
411
411
  /**
412
412
  * A message the paginator does not hold yet, at or after {@link latestMessageAt} (as known before
413
413
  * it arrives), while no loaded interval reaches the newest message. It is then the newest message,
414
- * so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}).
414
+ * so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}). In a
415
+ * channel whose newest page was loaded empty, with no newest message time known, any message is
416
+ * the newest.
415
417
  */
416
418
  private isNewNewestMessage(message: LocalMessage): boolean {
417
419
  if (this.anchoredHeadItem !== undefined || this.getItem(message.id)) return false;
418
420
  const latestMessageAt = this.latestMessageAt;
421
+ if (latestMessageAt === null) {
422
+ return this.items?.length === 0 && !this.hasMoreHead;
423
+ }
419
424
  const createdAt = getMessageCreatedAtTimestamp(message);
420
- return latestMessageAt !== null && createdAt !== null && createdAt >= latestMessageAt;
425
+ return createdAt !== null && createdAt >= latestMessageAt;
421
426
  }
422
427
 
423
428
  /**