-
Notifications
You must be signed in to change notification settings - Fork 432
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
fix(sanity): relative dates incorrectly appearing to be in the future #8034
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
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.
Really interesting case! I'll see if I can fix it properly in a follow up 🤔
No changes to documentation |
@stipsan Thank you! Just wanted to add a bandaid for now, but agree it would be good to understand and fix the root cause. |
⚡️ Editor Performance ReportUpdated Fri, 13 Dec 2024 11:45:31 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
Component Testing Report Updated Dec 13, 2024 11:45 AM (UTC) ❌ Failed Tests (6) -- expand for details
|
Description
It appears React Compiler is failing to see the base comparison date (
now
) as a dependancy when usinguseRelativeTime
to calculate a relative date. This causes the base comparison date (now
) to become stale, resulting in the relative date incorrectly appearing to be in the future.This affects the History inspector. Changes made externally (e.g. by another editor or the API) after the page loads may appear to be from the future:
Spooky! 👻
Switching off auto-memoization for
useRelativeTime
appears to solve the problem for now.What to review
Testing
Notes for release
Fixed a bug that could cause relative timestamps, such as those shown in the document history inspector, to incorrectly appear to be in the future.