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

Set updatedAt value for newly created documents #968

Closed
chacha912 opened this issue Aug 20, 2024 · 2 comments · Fixed by #977
Closed

Set updatedAt value for newly created documents #968

chacha912 opened this issue Aug 20, 2024 · 2 comments · Fixed by #977
Labels
bug 🐞 Something isn't working good first issue 🐤 Good for newcomers

Comments

@chacha912
Copy link
Contributor

What happened:

When creating a new document through the dashboard example, the updatedAt value is not displaying correctly in the document list. (Ref: yorkie-team/dashboard#99)

What you expected to happen:

When a document is first created, the updatedAt should be set to the same value as createdAt.
Reasons for this approach:

  1. Initial state indication: It clearly shows that the record has not been modified since its creation.
  2. Data consistency: All records will have an updatedAt value from the moment of creation.

How to reproduce it (as minimally and precisely as possible):

  1. Navigate to the dashboard
  2. Create a new document using the provided example
    image
  3. Check the document list
    image
  4. Observe that the updatedAt value is not correctly set

Anything else we need to know?:

Environment:

  • Operating system:
  • Browser and version:
  • Yorkie version (use yorkie version): 0.4.30
  • Yorkie JS SDK version: 0.4.28
@chacha912 chacha912 added bug 🐞 Something isn't working good first issue 🐤 Good for newcomers labels Aug 20, 2024
@window9u
Copy link
Contributor

Hello! I've identified an issue that needs fixing:

While working on this pull request, I realized that updated_at is only being updated when there's an operation in Change. This explains why updatedAt isn't set when a document is created.

I apologize for my mistake and will fix it immediately.

@hackerwins
Copy link
Member

@window9u There's no need to be sorry. It seems natural that bugs are created due to changes. I'll wait for your PR.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 🐤 Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants