Commit 226d7f8
fix: sort export translations by key name (Sentry TOLGEE-BACKEND-3ED)
The StructureModelBuilder requires translations sorted alphabetically
by key name path, but the database collation may return them in a
different order. Sort in GenericStructuredFileExporter.prepare() to
ensure correct ordering regardless of database collation.
Likely triggered by the branching feature (#3246, merged Feb 6) which
added a LEFT JOIN on Branch to the export query. The additional join
changed the query execution plan, surfacing a collation mismatch
between PostgreSQL's locale-aware sorting and Java's byte-by-byte
string comparison for keys with punctuation (e.g. "profile.my-goals"
vs "profile.my-goals.plan_other").
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent fae0255 commit 226d7f8
2 files changed
Lines changed: 27 additions & 1 deletion
File tree
- backend/data/src
- main/kotlin/io/tolgee/formats/genericStructuredFile/out
- test/kotlin/io/tolgee/unit/formats/json/out
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
309 | 335 | | |
310 | 336 | | |
311 | 337 | | |
| |||
0 commit comments