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

Issue with updatedAt field showing incorrect values in document list #253

Closed
blurfx opened this issue Jul 25, 2024 · 2 comments · Fixed by #254
Closed

Issue with updatedAt field showing incorrect values in document list #253

blurfx opened this issue Jul 25, 2024 · 2 comments · Fixed by #254
Assignees
Labels
bug 🐞 Something isn't working

Comments

@blurfx
Copy link
Member

blurfx commented Jul 25, 2024

What happened:

There is an issue with the updatedAt of a document showing another document updatedAt. Specifically, the updatedAt in the document list is being reversed and reflecting a different document's value.

This issue occurs during the bulk retrieval of document lists using this patch. In this process, there is no guarantee that the order of the keys passed to the DB query matches the order of the documents in the query result.

What you expected to happen:
The updatedAt field in the document list should accurately reflect the updatedAt of each respective document.

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

  1. Use the bulk retrieval method for document lists.
  2. Update some document
  3. Compare the updatedAt fields in the document list with the actual updatedAt values of the documents.

Anything else we need to know?:

I think this issue should be handled on the client side, because the query result(document list) from the server may not always contain all the documents of given keys.
For example, when document keys [1, 2, 3] are passed to the server and document 2 does not exist, result should be [1, 3].

Environment:

  • Operating system:
  • Browser and version:
  • CodePair version:
  • Yorkie version: v0.4.28
@blurfx blurfx added the bug 🐞 Something isn't working label Jul 25, 2024
@blurfx blurfx self-assigned this Jul 25, 2024
@blurfx
Copy link
Member Author

blurfx commented Jul 25, 2024

cc @raararaara

@raararaara
Copy link

To solve this issue, how about converting the result of yorkieDocumentList into [id, yorkieDocument] format and mapping it?

const yorkieDocumentList = await this.findManyFromYorkie(
slicedDocumentList.map((doc) => doc.yorkieDocumentId)
);

cc @blurfx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants