Skip to content

refactor: call the paginator intervals intervals, not windows - #1939

Merged
MartinCupela merged 3 commits into
release-v10from
martincupela/react-1075-rename-window-to-interval
Oct 22, 2026
Merged

MartinCupela merged 3 commits into
release-v10from
martincupela/react-1075-rename-window-to-interval

Conversation

@MartinCupela

@MartinCupela MartinCupela commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description of the changes, What, Why and How?

Follow-up to GetStream/stream-chat-js#1926 (REACT-1075). The paginators store what they loaded as intervals (Interval, itemIntervals, isHead / isTail), but many member names and comments called the same thing a "window". This PR uses one term. It has no behaviour changes and no public API changes: every renamed member is private or protected.

Terms, defined once

  • BasePaginator has a doc comment defining interval, head / tail, active interval, anchored head interval and logical head / tail interval. It doesn't mention messages, since it is the base class.
  • AGENTS.md asks for "interval" over "window" and points to that doc comment. CLAUDE.md's paginator notes use the terms.
  • "window" stays for the browser global and for time spans (throttle, delivery buffer, health check).

Renames

All private or protected.

Class Before After
BasePaginator scheduleWindowPublish() scheduleActiveIntervalPublish()
BasePaginator flushWindowPublish() flushActiveIntervalPublish()
BasePaginator withSingleWindowPublish() withSingleActiveIntervalPublish()
BasePaginator isWindowPublishSuspended isActiveIntervalPublishSuspended
BasePaginator projectActiveWindow() projectActiveInterval()
BasePaginator _windowPublishThrottle _activeIntervalPublishThrottle
BasePaginator _windowPublishSuspendDepth _activeIntervalPublishSuspendDepth
BasePaginator _staleWindowState _staleActiveIntervalState
BasePaginator slidOutOfHeadAnchoredWindow slidOutOfHeadAnchoredInterval
BasePaginator recordLoadedWindowQueryShape() recordLoadedIntervalQueryShape()
MessagePaginator isOwnSendWhileOlderWindowIsActive() isOwnSendWhileOlderIntervalIsActive()
MessagePaginator showWindowOfOwnSend() showIntervalOfOwnSend()
MessagePaginator showsNewestWindow showsNewestInterval
MessageIntervalPaginator replaceWindowsWithNewestPage() replaceIntervalsWithNewestPage()
MessageIntervalPaginator dropWindows() dropIntervals()
MessageIntervalPaginator droppedWindows droppedIntervals
MessageIntervalPaginator ingestPageAsHeadWindow() ingestPageAsHeadInterval()
MessageIntervalPaginator headWindow, pageWindow, heldByAnotherWindow, window(s) (locals) headInterval, pageInterval, heldByAnotherInterval, interval(s)
MessageIntervalPaginator belowWindow idsTailwardOfPage
MessageIntervalPaginator windowLowTs pageTailTs
MessageIntervalPaginator pruneBelowWindowIfReachedStart() removeIdsTailwardOfPageIfNothingOlder()
MessageIntervalPaginator anchorId, headId, head (in that method) pageTailId, headIdBeforeRequest, headAfterRequest
MessageIntervalPaginator _belowWindowReconcile _pendingTailwardOfPageRemoval

removeIdsTailwardOfPageIfNothingOlder is named for what it does. When a reload of a head interval that was at the channel start returns a page missing its oldest messages, the page alone can't tell deleted messages from older ones it was too short to include. The method asks the server for one message older than the page's oldest. When there is none, it removes them and marks the head interval as the tail.

Comments: about 320 "window"s in src/ comments now say "interval", "active interval" or "shown interval".

Not included

  • Test helper names and test titles that say "window" (seedLatestWindow, windowOf, MessagePaginatorWindowCap.test.ts).
  • ai-docs/v10-breaking-changes.md, which describes behaviour to integrators.

Checks

  • yarn types and yarn lint pass. Prettier flags only untracked local files.
  • yarn test: 4740 pass. The 1 failure is notificationTypes.test.ts, which depends on untracked local files and fails on release-v10 too.

Changelog

  • No user-facing changes.

🤖 Generated with Claude Code

MartinCupela and others added 3 commits October 22, 2026 14:19
Renames the private and protected paginator members and the comments that called a loaded
interval a window, e.g. scheduleWindowPublish -> scheduleActiveIntervalPublish,
replaceWindowsWithNewestPage -> replaceIntervalsWithNewestPage, headWindow -> headInterval,
belowWindow -> idsTailwardOfPage. BasePaginator gets a doc comment defining the interval terms.
"window" stays for the browser global and time spans. No public API changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md asks for "interval" over "window" and points to BasePaginator's doc comment;
CLAUDE.md's paginator notes use the terms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pruneTailwardOfPageIfReachedStart -> removeIdsTailwardOfPageIfNothingOlder: it asks the server
whether anything is older than the page's oldest message and removes the loaded messages tailward
of the page only when nothing is. Its variables name what they hold (pageTailId,
headIdBeforeRequest, hasMessagesOlderThanPage, headAfterRequest), and the pending request is
_pendingTailwardOfPageRemoval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MartinCupela
MartinCupela merged commit 69aa18a into release-v10 Oct 22, 2026
6 checks passed
@MartinCupela
MartinCupela deleted the martincupela/react-1075-rename-window-to-interval branch October 22, 2026 13:50
github-actions Bot pushed a commit that referenced this pull request Oct 26, 2026
## [10.0.0-rc.25](v10.0.0-rc.24...v10.0.0-rc.25) (2026-10-26)

### ⚠ BREAKING CHANGES

* Channel.watch() resolves with the channel instance to use (the channel, or the instance that superseded it) instead of the server response.
- watch() sends no query for a channel that is already watched and loaded (watchStatus Watching, initialized, and messagePaginator.hasResults) when it passes no options or the same options as the last successful watch() during the current watch; other options send a query. It no longer refreshes a watched channel: use channel.reload(), and load other messages through channel.messagePaginator (jumpToMessage(), toTail(), toHead()).
- A watch() while another with the same options is in flight joins it instead of sending a request.
- Aborting requestOptions.signal ends only that caller's wait; the request is cancelled once every caller waiting for it has aborted.
- Channel.ensureWatched() is removed (v10 release candidates only); call watch().
```

## Changelog

- `Channel.watch()` resolves with the channel and sends no query for a
channel already watched and loaded, unless it asks for options the
current watch was not sent with. `Channel.ensureWatched()` is removed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

### Bug Fixes

* channel list reconciliation ([#1942](#1942)) ([f7f9ec8](f7f9ec8))
* count hidden messages on each side of a jump page ([#1940](#1940)) ([487ac3d](487ac3d))
* **poll:** keep translations from poll.updated in the poll state ([#1937](#1937)) ([e47b75a](e47b75a)), closes [#1878](#1878)

### Refactors

* call the paginator intervals intervals, not windows ([#1939](#1939)) ([69aa18a](69aa18a))
* **channel:** remove no-op overrides, dead branch and redundant id guards ([#1936](#1936)) ([050953e](050953e)), closes [#1870](#1870)
* make Channel.watch() watch a channel only when it is not watched and loaded ([#1943](#1943)) ([3c363cb](3c363cb))
@stream-ci-bot

Copy link
Copy Markdown

🎉 This PR is included in version 10.0.0-rc.25 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants