Skip to content

fix: saving settings reads the translations only for a new syntax - #110

Merged
explodi merged 1 commit into
mainfrom
settings-read-only-what-changes
Nov 27, 2026
Merged

explodi merged 1 commit into
mainfrom
settings-read-only-what-changes

Conversation

@explodi

@explodi explodi commented Nov 27, 2026

Copy link
Copy Markdown
Owner

The problem

Saving any setting failed on a large project with "The database is unavailable. Try again shortly."

updateSettingsAsync read every translation of the project on every save, to recheck them against the interpolation syntax. Only a change of syntax uses 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 check passes.
  • New case in 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.

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."
@explodi
explodi merged commit 67e3874 into main Nov 27, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant