Skip to content

feat: _createdAt and _lastUpdatedAt #2426

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 4 commits into from
Jun 5, 2025
Merged

feat: _createdAt and _lastUpdatedAt #2426

merged 4 commits into from
Jun 5, 2025

Conversation

emmyoh
Copy link
Member

@emmyoh emmyoh commented Jun 3, 2025

Closes #2410.

@emmyoh emmyoh self-assigned this Jun 3, 2025
@emmyoh emmyoh added the enhancement Adding new features or extending existing capabilities label Jun 3, 2025
@emmyoh emmyoh added this to 🚢 Jun 3, 2025
Copy link

vercel bot commented Jun 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
design-system ❌ Failed (Inspect) Jun 4, 2025 10:49pm
file-upload-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
form-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
gcmp-homepage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
image-upload-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-chat-1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-chat-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-homepage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-inspector ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-multi-cursors ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-organization ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-paper-scissors ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-pets ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-richtext ❌ Failed (Inspect) Jun 4, 2025 10:49pm
jazz-richtext-tiptap ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-todo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
jazz-version-history ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
music-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
passkey-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
passphrase-auth-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
passwords-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm
reactions-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:49pm

@emmyoh emmyoh requested a review from gdorsi June 3, 2025 20:36
@emmyoh emmyoh moved this to In Progress in 🚢 Jun 3, 2025
@@ -75,6 +77,7 @@ export class RawCoMapView<
this.id = core.id as CoID<this>;
this.core = core;
this.latestTxMadeAt = 0;
this.earliestTxMadeAt = Number.MAX_SAFE_INTEGER;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can read the creation date from the header (core.verified.header.createdAt)

This way we can get the value even if the CoMap is empty, and fallback to the max integer only of the comap is empty and the createdAt in the header is not set (should never happen, because the CoValues that have no createdAt in the header have always some content)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks so much! So, you're saying we can assume createdAt will always be in the header, but if it isn't we can return Number.MAX_SAFE_INTEGER?

@gdorsi gdorsi merged commit f674910 into main Jun 5, 2025
40 of 43 checks passed
@gdorsi gdorsi deleted the emil/comap-time-getters branch June 5, 2025 10:23
@github-project-automation github-project-automation bot moved this from Waiting for feedback to Done in 🚢 Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding new features or extending existing capabilities
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Feature: add _createdAt and _lastUpdatedAt getters on CoMap
2 participants