gitlocalize / feedback

:mega: We love feedback :sparkles:
20 stars 8 forks source link

Catastrophic data loss (several translator pending Review Requests) after pushing JSON locale updates to GitHub #138

Open danielweck opened 2 months ago

danielweck commented 2 months ago

Summary

pending Review Requests closed and data destroyed after we pushed commits to our project branch that changed the JSON locales (not a major update, just a single label)

https://github.com/edrlab/thorium-reader/issues/2219#issuecomment-2118396811

https://github.com/edrlab/thorium-reader/commit/b3e2d8c444ac6d20ff615e133f16abde84c551e5#diff-da7119d1c8c008d685d71dd864febae06da76c518a53683034f8ec52fcece6d8

Steps to reproduce

N/A

Repository URL

What is the current bug behavior?

Complete data loss (error 500)

What is the expected correct behavior?

pending Review Requests should not be destroyed after commits / pushes to GitHub branch.

Relevant logs and/or screenshots

Screenshot 2024-05-17 at 22 27 48 Screenshot 2024-05-17 at 22 27 31

Possible fixes

Could you please check your logs to try understand what causes data loss?

danielweck commented 2 months ago

I hope you will be able to identify the cause of this behaviour. If this is a bug, then hopefully it can be fixed. If this is "normal" / expected behaviour, then I fear we must switch to a different translation system that can survive incremental updates to the JSON locale.

svasilenkov commented 1 month ago

@danielweck Thank you for your feedback. Currently, the most effective solution to the issue is to close any open review requests and recreate them, as your translations have not been lost. They are also preserved in the translation memory, which provides suggestions when you translate specific text segments. Since it appears you've encountered a 500 error when closing the review requests, I would recommend simply recreating them.

danielweck commented 1 month ago

Thank you for chiming in @svasilenkov , much appreciated.

Well, our volunteer translators kindly restarted their work and created a new Review Request each, which we quickly converted into GitHub Pull Requests in order to make their contributions more persistent as actual GitLocalize branches in our project repository (the GitLocalized-managed branches are auto-deleted after merge, but that's fine of course).

I would have liked to see GitLocalize fully embrace a Git (CVS) -oriented approach where file divergence between a "working copy" (e.g. Review Request, not yet materialised as a GitHub upstream Pull Request) and its original source doesn't cause a 500 or other fatal error :)

Anyway, the service is free and simple (ish) to use, so I appreciate that it exists :) Thank you.

PS: because we do not feel that it is safe to update (directly in upstream project source tree) JSON locales other than the reference "master" English one (by fear of breaking opened GitLocalize Review Requests) we are forced to adapt our workflow which used to include a normalization step that helped greatly with file diffs in Git: (1) JSON indentation with 4 spaces, (2) alphanumerical sorting of all JSON keys (recursively of course), and (3) missing translated labels encoded as empty strings (no undefined keys). Not a huge deal breaker, we expect and accept that working with an opinionated non-configurable tool requires some compromise. But of course we would have preferred to keep our JSON locales "clean" / normalized as per our project conventions.