Skip to content

Leave query logging off after loading a configuration file - #2466

Open
kmcginnes wants to merge 1 commit into
mainfrom
t3/implement-issue-2462
Open

kmcginnes wants to merge 1 commit into
mainfrom
t3/implement-issue-2462

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Loading a configuration file restored Enable database query logging on proxy server along with everything else. Turning that diagnostic setting on should always be a choice made in Settings.

User-facing: after Load Configuration, query logging is off, even when the file was saved with it on. Turn it back on in General Settings if you need it.

 applyRestorePrefixToEntries(data)
   Object.entries(data)
+    .filter(key not in keysSkippedOnRestore)   // { ALLOW_LOGGING_DB_QUERY_STORAGE_KEY }
     .map(add restored prefix)

The key now lives in storageKeys.ts, shared by the setting's atom and the restore filter so the two can't drift. Saving is unchanged, and files that contain the setting still load. The Load Configuration docs note the new behavior.

Evidence

Before: restoring a backup with allowLoggingDbQuery: true wrote it back, so query logging stayed on.
After: new tests in localDb.test.ts pass, and the first fails with the filter removed:

should not restore the query logging setting
  backup has allowLoggingDbQuery = true
  restoreBackup → key absent, other entries restored
should turn off query logging when the backup does not contain it
  local db has allowLoggingDbQuery = true
  restoreBackup → key absent

Verified live: loaded a file with the setting on in the UI dev server. After the reload the toggle was off, the other entries were restored, and Save still wrote the key.

Merge Danger

Door: two-way

Impact: settings

Anyone who relies on query logging turns it back on after a restore.

Related

* Query logging sends query text to the proxy server's logs, so turning it
* on must always be an explicit choice in Settings.
*/
const keysSkippedOnRestore = new Set(["allowLoggingDbQuery"]);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a shared constant with the storage atom so the keys don't drift?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the key to ALLOW_LOGGING_DB_QUERY_STORAGE_KEY in storageKeys.ts, shared by the atom and the restore filter.

Layer: 1-skip-query-logging-on-restore
@kmcginnes
kmcginnes force-pushed the t3/implement-issue-2462 branch from ea83392 to a01cfd6 Compare October 23, 2026 02:00

This branch has not been deployed

No deployments
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.

Don't restore the query logging setting from backup files

1 participant