Skip to content
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

Bug: Playground comments have inconsistent timestamps in different window contexts #6554

Closed
irahopkinson opened this issue Aug 26, 2024 · 1 comment · Fixed by #6555
Closed

Comments

@irahopkinson
Copy link
Contributor

When adding collaborative comments, the timestamps are inconsistent in different window contexts.

Lexical version: 0.17.0

Steps To Reproduce

  1. Clone this repo and do relevant npm i.
  2. In the playground package, run npm run dev.
  3. Open http://localhost:3000/?isCollab=true in 2 different tabs.
  4. Add some text and add a comment.
  5. Wait a minute until the comment time stamp says "1 min. ago".
  6. Reload only one browser tab.
  7. Observe the comment time says "Just now" which is now different from the other tab.

Link to code example: use the playground in this repo (see reproduction steps above).

The current behavior

Comment timestamps are inconsistent in different window contexts.

The expected behavior

Comment timestamps are the same in different window contexts.

Impact of fix

This isn't affected if you test with the Split Screen option as it's always the same window context. But for all other usual scenarios the inconsistent timestamps are disconcerting.

@etrepum
Copy link
Collaborator

etrepum commented Aug 26, 2024

Comments in the playground are just a playground tech demo, not an exported package suitable for re-use. The timestamp uses the performance counter without basing it on the timeOrigin (or just using Date.now) so it really doesn't make a lot of sense when used in more than one tab, browser or window. Could certainly be fixed if you're inclined to write a PR.

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 a pull request may close this issue.

2 participants