Open zerolab opened 4 weeks ago
@zerolab Yeah, the hash/fingerprint approach makes sense to me, too.
One question, to check I understand the root cause:
sync translation without any content changes, and mark for Smartling. Got another Job
Is that case of Job 1 existing at Smartling, but it hasn't come back yet, and somehow Job 2 for the same page is made because it still looks untranslated on the Wagtail end?
Is that case of Job 1 existing at Smartling, but it hasn't come back yet, and somehow Job 2 for the same page is made because it still looks untranslated on the Wagtail end?
It is a bit more complex than this. "sync translation" from Localize doesn't do anything special in that it literally goes "here's my source, update the chosen targets". If there are changes, the target translations (page, snippet etc) get the updates. Because of that anything extra needs additional checks. In our case we have to account for:
and potentially consider the edge case where the source page got an update to a field that is not translatable, gets synced and we now have a Job that is virtually the same as a previously completed one 🙈 (this is more of a process thing at this point)
Scenario:
Potential fix:
content_json
hash against active jobs with the same translation source. If any exist, skip creating a new job (with an appropriate message)