-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(core): update events api routes and config flags, fix events sorting #8369
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
No changes to documentation |
Component Testing Report Updated Jan 27, 2025 4:35 PM (UTC) ❌ Failed Tests (1) -- expand for details
|
⚡️ Editor Performance ReportUpdated Mon, 27 Jan 2025 18:44:11 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
83fbfeb
to
d9bbcbd
Compare
52f12af
to
985bfd1
Compare
985bfd1
to
a8d7760
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
// @ts-expect-error enabled is a legacy option we want to warn beta testers in case they have enabled it. | ||
if (innerConfig.beta?.eventsAPI?.enabled) { | ||
throw new Error( | ||
`The \`beta.eventsAPI.enabled\` option has been removed. Use \`beta.eventsAPI.${opts.key}\` instead.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to warn these folks 👍.
expandedEvents: EditDocumentVersionEvent[] | ||
}): DocumentGroupEvent[] { | ||
const eventsWithRemoteEdits = [...remoteEdits, ...events, ...expandedEvents].sort( | ||
// Sort by timestamp, newest first unless is an edit event that has a corresponding publish event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch and nice test coverage.
Description
This PR updates the events api routes that we were using.
The routes now will be:
data/history/{datasetName}/events/documents/{ids}
data/history/{datasetName}/events/releases/{id}
It also modifies the config flag we have added for the events api and enables it by default for documents events for all the studios.
It's kept as a flag in case we need to turn it off.
Releases events are not ready to be used by everyone yet, so a new flag has been added to handle this. It will be enabled by default in the
playground
studio.It also updates the sort algorithm for the events, given the timestamp validation is not the only check necessary, because edit and publish events now have the same timestamp and the order was incorrect.
What to review
Testing
Notes for release