yorkie-team / yorkie

Yorkie is a document store for collaborative applications.
https://yorkie.dev
Apache License 2.0
771 stars 143 forks source link

Set updatedAt value for newly created documents #968

Closed chacha912 closed 1 week ago

chacha912 commented 3 weeks ago

What happened:

When creating a new document through the dashboard example, the updatedAt value is not displaying correctly in the document list. (Ref: https://github.com/yorkie-team/dashboard/issues/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:

window9u commented 3 weeks ago

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 commented 3 weeks ago

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