Skip to content

tmp-do-not-merge - #1810

Closed
arnautov-anton wants to merge 47 commits into
release-v10from
tmp-oapi-merge
Closed

tmp-do-not-merge#1810
arnautov-anton wants to merge 47 commits into
release-v10from
tmp-oapi-merge

Conversation

@arnautov-anton

Copy link
Copy Markdown
Contributor

No description provided.

Support setting paginator items directly, optional request retries, offline DB in ChannelPaginator, identification of pagination restart based on query shape change.
…eat/message-paginator

# Conflicts:
#	src/channel.ts
#	src/client.ts
….messages.deleted and message.deleted events
MartinCupela and others added 17 commits March 6, 2026 00:43
Resolve all 7 textual conflicts + hidden semantic conflicts from folding
PR #1674 into current master (release-v10). Types pass; 3462/3469 unit
tests pass.

Notable resolutions:
- member.added/removed: keep master fix #1761 (drop PR's reintroduced
  member_count double-count).
- UserGroupPaginator (#1743): ported to the new paginators/BasePaginator<T,Q>.
- client.ts / textComposer types / pagination barrel: unioned, dead code dropped.

Known remaining failures tracked in specs/.../decisions.md (own_capabilities
design decision + 3 items needing diagnosis). WIP checkpoint; not pushed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- own_capabilities (Option B): keep reactive getter/setter but return
  undefined until loaded, preserving #1732 unread on uninitialized channels;
  update PR's 'undefined ID no options' expectation.
- UserGroupPaginator: stable query shape + apply forward cursor in query()
  so pages accumulate (new base resets list on query-shape change).
- orchestrator test: expect item:undefined on notification.removed_from_channel
  (master #1788 evicts channel from activeChannels).
- messageComposer config test: add master's trackUploadProgress + commands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rge' into feat/message-paginator-master-merge
## CLA

- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required).
- [ ] Code changes are tested

## Description of the changes, What, Why and How?

## Changelog

-
## CLA

- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required).
- [ ] Code changes are tested

## Description of the changes, What, Why and How?

## Changelog

-
## CLA

- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required).
- [ ] Code changes are tested

## Description of the changes, What, Why and How?

## Changelog

-
…ith paginators (#1806)

### Summary

Completes the `message-paginator` initiative on the LLC side: the
channel's **messages, thread replies, and pinned messages are no longer
stored on `channel.state`**. Each list now lives in a paginator that is
the single source of truth (interval storage + a canonical `ItemIndex`):

- **Main message list** → `channel.messagePaginator`
- **Thread replies** → `thread.messagePaginator` (owned by the `Thread`
object)
- **Pinned messages** → `channel.pinnedMessagesPaginator` (new
`PinnedMessagePaginator`)

### What changed

- **`ChannelState` storage removed:** `messages`, `latestMessages`,
`messageSets`, `messagePagination`, `threads`, `pinnedMessages`, and
their mutators (`addMessageSorted`/`addMessagesSorted`, `removeMessage`,
`findMessage`, `findMessageByTimestamp`, `filterErrorMessages`,
`loadMessageIntoState`, `clearMessages`, `initMessages`, `pruneOldest`,
`addReaction`/`removeReaction`, `updateUserMessages`,
`deleteUserMessages`,
`addPinnedMessages`/`addPinnedMessage`/`removePinnedMessage`,
`removeQuotedMessageReferences`, + internal helpers).
- **`PinnedMessagePaginator`** added and populated from channel events;
pin/unpin falls out of `ingestItem` + a `{ pinned: true }` filter (no
bespoke branching).
- **`MessageIntervalPaginator`** extracted as the unread-free base of
`MessagePaginator`; it tracks the latest message (`latestMessageId` +
`latestMessage`), advanced on ingest and mirrored into reactive state.
- **`channel.state.last_message_at`** is now a **read-only getter**
derived from `messagePaginator.latestMessage` (setter + backing field
removed).
- **`channel.state.isUpToDate` / `setIsUpToDate` removed** —
live-message routing (don't disrupt a scrolled-away view) is handled
structurally by the paginator's interval model.
- **`Channel._trackLatestMessage` removed.** `user.updated` /
`user.deleted` propagation now scans active channels
(`reflectUserUpdate` / `applyMessageDeletionForUser` self-filter by
author id). A targeted user-reference index is planned
(`specs/user-reference-index`).
- **`utils` cleanup:** removed `addToMessageList`,
`messageSetPagination`, `binarySearchByDateEqualOrNearestGreater`,
`deleteUserMessages`, and the `MessageSet` / message-set pagination
types.
- **Reactive `headItems`** added to `PaginatorState` (newest-loaded
window).
- **Removed the unused `MessageReplyPaginator`** (dead sibling; the
thread reply list uses `MessagePaginator`).

### Breaking changes

Full list + before → after migration table in
**`docs/breaking-changes-v14-v15.md`**. Highlights:

| Before (v14) | After (v15) |
| --- | --- |
| `channel.state.messages` | `channel.messagePaginator.state.items` /
`.items` |
| `channel.state.threads[parentId]` |
`thread.messagePaginator.state.items` |
| `channel.state.pinnedMessages` |
`channel.pinnedMessagesPaginator.state.items` |
| `channel.state.addMessageSorted(m)` |
`channel.messagePaginator.ingestItem(m)` |
| `channel.state.removeMessage({ id })` |
`channel.messagePaginator.removeItem({ id })` |
| `channel.state.findMessage(id)` |
`channel.messagePaginator.getItem(id)` |
| `channel.state.isUpToDate` / `setIsUpToDate` |
`messagePaginator.isActiveIntervalAtHead` / `hasMoreHead` /
`jumpToTheLatestMessage()` |
| `channel.state.last_message_at = …` | read-only (derived); ingest a
message on the paginator |

Behavioral note: `last_message_at` now advances on every incoming
message regardless of the viewer's scroll position (the old `isUpToDate`
suppression is gone) — it's a channel-level fact.

### Follow-ups (not in this PR)

- **`specs/user-reference-index`** — replace the active-channel scan on
`user.updated`/`user.deleted` with a `userId → message-reference` index
(design-gated).
-  Unifying the remaining flat paginators on interval storage
- Offline migration

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@arnautov-anton
arnautov-anton force-pushed the tmp-oapi-merge branch 2 times, most recently from e6dfe79 to 896f499 Compare July 29, 2026 14:51
@arnautov-anton
arnautov-anton deleted the tmp-oapi-merge branch July 29, 2026 14:53
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.

3 participants