Repository navigation
fix: saving settings reads the translations only for a new syntax - #110
Merged
Merged
Conversation
Every settings change read every translation of the project, to recheck them against the interpolation syntax, though only a change of the syntax uses them. On a large project that read is more than the database answers at once, so no setting could be saved: "The database is unavailable."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Saving any setting failed on a large project with "The database is unavailable. Try again shortly."
updateSettingsAsyncread every translation of the project on every save, to recheck them against the interpolation syntax. Only a change ofsyntaxuses those rows. On a project of about 70,000 translations that one read is more than the database returns in one answer (D1 refuses a result over 50 MB, and the Worker that carries it runs out of memory before that), and the gateway reports every such failure as unavailable.The change
The translations are read only when the request names
syntax. Any other change reads none.A change of syntax on a project this large still reads everything in one answer and still fails. So does a full upload, whose batch is the same size. Those need their reads split and are not in this PR.
Checked
npm run checkpasses.settings_writes_cases.ts: a change that is not the syntax reads no translation. It runs against every SQL adapter the shared cases run against.