Skip to content

Add Timestamp to the SDK, moving it out of client_api #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 8, 2025

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Oct 16, 2024

Description of Changes

Companion to SpacetimeDB#1836.

Based off #109

API

  • This is an API breaking change to the SDK

Type of ReducerEvent.timestamp is changed, methods on Timestamp are different, and WS API is updated.

Requires SpacetimeDB PRs

List any PRs here that are required for this SDK change to work

Copy link

changeset-bot bot commented Oct 16, 2024

⚠️ No Changeset found

Latest commit: a29bc9b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Oct 16, 2024

Open in Stackblitz

npm i https://pkg.pr.new/@clockworklabs/spacetimedb-sdk@114

commit: a29bc9b

Base automatically changed from gzip to main October 23, 2024 16:57
@gefjon gefjon marked this pull request as ready for review February 4, 2025 15:06
Copy link
Contributor

@kazimuth kazimuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything here makes sense.

gefjon and others added 8 commits February 8, 2025 13:15
From SpacetimeDB 072c2ea3a32a6cf6d05ecf1ac9c9b54a4f95e340:

Prioritize BSATN and BFLATN compat with 0.12

Timestamp and TimeDuration store `micros: i64`, not `nanos: i64`.
This means that old commitlogs and snapshots should still be compatible,
assuming they don't include timestamps greater than `i64::MAX`,
as previously we used `micros: u64`. This seems unlikely.
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I ended up reimplementing most of this in a future PR so I am quite familiar with it.

@cloutiertyler cloutiertyler merged commit 9884068 into main Feb 8, 2025
7 of 8 checks passed
@cloutiertyler cloutiertyler deleted the phoebe/timestamp branch February 8, 2025 18:26
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