Skip to content

feat!: move to timestamps in response models - #3794

Merged
szuperaz merged 13 commits into
V10from
remove-date-transform
Sep 3, 2026
Merged

feat!: move to timestamps in response models#3794
szuperaz merged 13 commits into
V10from
remove-date-transform

Conversation

@szuperaz

@szuperaz szuperaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Relevant stream-chat-js PR: GetStream/stream-chat-js#1849

Breaking changes

  • findInMessagesByDate takes a timestamp, not a Date
  • OfflineStoreApis.deleteMessagesForChannel truncation cursor is now a timestamp not a Date object

DB schema is also updated and stores dates as integer rather than string.

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

@szuperaz
szuperaz marked this pull request as ready for review September 1, 2026 07:45
szuperaz and others added 9 commits September 1, 2026 16:44
- Four row-to-model mappers assigned number | undefined to created_at and
  updated_at, which the response models declare required. The trailing
  ...JSON.parse(extraData) spread is `any`, which disables assignability
  checking for the whole literal, so tsc could not see it. They now use ?? 0,
  matching the six sibling mappers. mapStorableToUser.role had the same problem.
- MessageList: convert the resync gate left as truthiness, while its
  byte-identical twin in MessageFlashList was already converted. A created_at
  of 0 skipped the scroll-to-bottom, pagination reset, and mark-read.
- SampleApp: restore the guarded convertTimestampToDate in MessageSearchList,
  which had been swapped for the unguarded nsToDate, and fix the || on
  first_reaction_at that the same sweep missed one file over.

Adds mapperRequiredTimestamps.test.ts, verified to fail when the guards are
reverted, and records the any-spread trap on mapStorableToTimestamp.
@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 2031 KB 2021 KB -10050 B 🚀

@szuperaz
szuperaz merged commit 1ccd442 into V10 Sep 3, 2026
3 of 4 checks passed
@szuperaz
szuperaz deleted the remove-date-transform branch September 3, 2026 12:10
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