vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.61k stars 993 forks source link

The `updatedAt` timestamp does not change for translatable entities when their translations are updated #1464

Closed skid closed 8 months ago

skid commented 2 years ago

The updatedAt column of translatable entities (e.g. Product) does not change when their translations are updated - only the translation's updatedAt column does. The intuitive expectation would be: When I change a product's name, its updatedAt timestamp should change too.

timcv commented 8 months ago

Hi @michaelbromley,

I want to sync product data to another system and it would make it easier if i could check if the products is updated since the last sync.

Do you have any idea about how to solve this issue or ay idea about how to make a workaround for this issue? If you have a if you have a rough idea of how to solve it, maybe we can help.

Thanks in advance

/Tim

michaelbromley commented 8 months ago

Hi,

I think a solution would involve modifying the TranslatableSaver.update() method so that it manually sets the updatedAt field on the translation's parent entity and persists that to the DB.

A work-around that you could use for now though would be to define a custom field on the product which stores the last update time, and use the EventBus to subscribe to changes with the ProductEvent and use that to update your custom field.

michaelbromley commented 8 months ago

/bounty $30

algora-pbc[bot] commented 8 months ago

💎 $30 bounty • Vendure

Steps to solve:

  1. Start working: Comment /attempt #1464 with your implementation plan
  2. Submit work: Create a pull request including /claim #1464 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to vendure-ecommerce/vendure!

Add a bounty • Share on socials

Attempt Started (GMT+0) Solution
🟢 @furo321 #2630
algora-pbc[bot] commented 8 months ago

💡 @furo321 submitted a pull request that claims the bounty. You can visit your bounty board to reward.