Skip to content

feat!: remove response date transform - #1849

Merged
szuperaz merged 11 commits into
release-v10from
remove-date-transform
Sep 3, 2026
Merged

feat!: remove response date transform#1849
szuperaz merged 11 commits into
release-v10from
remove-date-transform

Conversation

@szuperaz

@szuperaz szuperaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Breaking changes

  • Remove date response transformation -> date fields in response models changed from Date to number (nanosecond timestamp).
  • Removed addModerators and demoteModerators methods. Setting a user's role is not possible on the client side; a recent open API fix removed the unnecessary fields from code.

The change can produce runtime errors not caught by TS compiler; integrators should check their code for these potential issues:

# the idioms that now fail silently
grep -rn "isDate(\|instanceof Date\|\.getTime?\?\.\?(\|as string | Date" src

# every surviving `new Date(x)` with an argument
grep -rn "new Date([^)]" src

@szuperaz
szuperaz marked this pull request as ready for review September 1, 2026 07:46
szuperaz and others added 6 commits September 1, 2026 16:43
Server-sent dates are unix-nanosecond numbers now, and several call sites
guarded only for nullish, which admits NaN and a leftover ISO string.

- LiveLocationManager: arm the stop-sharing timer in steps. setTimeout clamps
  any delay past 2^31-1 ms (~24.9 days) to 1 ms, so a longer share unregistered
  itself on the next tick, and only a minimum share duration is enforced. Also
  replaces the unsound cast to the end_at-required overlay with a narrowing
  predicate, since end_at is optional on the wire.
- MessageReceiptsTracker: check Number.isFinite in isValidReadState, matching
  the sibling that already did. A non-finite last_read resolved to the newest
  loaded message via locateMessage, reporting the whole channel as read.
- MessagePaginator: skip the created_at_around query for a non-finite
  lastReadAt, which otherwise went out as created_at_around: null. The epoch
  stays a valid boundary.
- client._normalizeExpiration: throw when a numeric offset does not resolve to
  a representable date, rather than an opaque RangeError from toISOString().
- thread: route the read-state timestamp fallbacks through a finiteness check.

Adds 13 regression tests, each verified to fail when its fix is reverted, and
migrates the LiveLocationManager fixtures off ISO strings so the suite exercises
the wire unit.
@szuperaz
szuperaz merged commit ef5dcc6 into release-v10 Sep 3, 2026
4 checks passed
@szuperaz
szuperaz deleted the remove-date-transform branch September 3, 2026 11:21
github-actions Bot pushed a commit that referenced this pull request Sep 3, 2026
## [10.0.0-rc.9](v10.0.0-rc.8...v10.0.0-rc.9) (2026-09-03)

### ⚠ BREAKING CHANGES

* remove response date transform (#1849)

### Features

* remove response date transform ([#1849](#1849)) ([ef5dcc6](ef5dcc6))
@stream-ci-bot

Copy link
Copy Markdown

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

The release is available on:

Your semantic-release bot 📦🚀

szuperaz added a commit to GetStream/stream-chat-react that referenced this pull request Sep 3, 2026
Relevant stream-chat-js PR:
GetStream/stream-chat-js#1849

## Breaking changes
- `MessageListProps.headerPosition` is now nanoseconds
- `ChatContextValue. latestMessageDatesByChannels` record now stores
nanoseconds instead of Dates
- `VirtualizedMessageListProps. lastReadDate` is now nanoseconds instead
of Date
- `ProcessMessagesContext.lastRead` is now nanoseconds instead of Date
- `ProcessMessagesParams.lastRead` is now nanoseconds instead of Date

The change can produce runtime errors not caught by TS compiler;
integrators should check their code for these potential issues:

```
# the idioms that now fail silently
grep -rn "isDate(\|instanceof Date\|\.getTime?\?\.\?(\|as string | Date" src

# raw timestamps interpolated into translations
grep -rn "t(.*timestamp\|t(.*date" src

# every surviving `new Date(x)` with an argument
grep -rn "new Date([^)]" src

```

---------

Co-authored-by: Oliver Lazoroski <oliver.lazoroski@gmail.com>
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