After an article is published, it is expected to appear listed in the "published" list in the dashboard. Currently, after publishing it, the auto-save process can mark it as "in-progress" even if no changes have been made by the user, which is not expected.
There are two cases that can result in this problem:
- Translator was editing some sections. Autosave was happening in its triggers (timers, debounced events), Translator publish it. While the publish was happening, the save was also going on in parallel (either started before or along with publish OR from a debounced event handler - implies non-empty save queue).
- A published translation is restored(opened in the editor). No changes were done by translator. Some save happened, putting the translation into draft state.
For the case #1, the tool can wait for empty save queue before publish request is sent to backend. This can be done by checking for save queue, process it, wait for response, and do publish call. During this time Publish button shows 'Publishing', considering the previous clean-up as part of the publishing process and to abstracts the internal steps from user.
For the case #2, we should make sure no save happens in a restored translation without a real user edit. Autosaving should not be triggered until the user makes further changes to the content.