Repository navigation
fix(database): stop logging per page load and leaking two listeners - #1125
Merged
Merged
Conversation
Two problems the database page introduced. A rule whose formula cannot be evaluated was logged as a warning. That is not an exceptional condition: a variable that is not numeric on this particular server is ordinary — MariaDB reports concurrent_insert as AUTO where MySQL reports an integer — and it happens on every run. The effect was a warning written to nextcloud.log every time the page was opened, which then inflated the "Errors in the log" setup check on the same Overview page the database warning was added to. Verified on a MariaDB instance: three runs used to add three lines, and now add none. Nothing is lost by dropping the level. The rule already reports itself as skipped with the reason attached, which is where an admin should read it; the log line was only ever diagnostic detail. The apply-descriptor failure next to it stays a warning, because that one means a rule is written wrong rather than that the server is different. The other problem was two event listeners registered with anonymous handlers and never removed: visibilitychange in the live charts and hashchange on the settings page. Both are now named and taken off on unmount, which is what useLiveData already does. Signed-off-by: Frank Karlitschek <frank.karlitschek@nextcloud.com> Assisted-by: Claude Code:claude-opus-5 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
Base automatically changed from
feat/database-setup-check
to
feat/database-checks
September 9, 2026 17:32
This was referenced Sep 9, 2026
Member
Author
|
/backport to stable35 |
|
The backport to # Switch to the target branch and update it
git checkout stable35
git pull origin stable35
# Create the new backport branch
git checkout -b backport/1125/stable35
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 69909cda
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/1125/stable35Error: Failed to check for changes with origin/stable35: No changes found in backport branch Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
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.
Two regressions the database page brought with it.
A warning in the log on every page load
A rule whose formula cannot be evaluated was logged at warning level. That is not an exceptional condition: a variable that is not numeric on this particular server is ordinary — MariaDB reports
concurrent_insertasAUTOwhere MySQL reports an integer — and it happens on every single run.The effect compounded badly. Every visit to the database page wrote a warning to
nextcloud.log, and those entries are counted by core's "Errors in the log" setup check — on the very Overview page #1124 adds the database warning to. One new feature was quietly degrading another.Measured on a MariaDB instance:
failed to evaluate formulalinesNothing is lost by dropping the level. The rule already reports itself as skipped with the reason attached, which is where an admin should read it:
The log line was only ever diagnostic detail, so it is now
debug. The apply-descriptor failure sitting next to it stays a warning on purpose: that one means a rule is written wrong, rather than that this server is different from the one the rule was written for.Two leaked event listeners
visibilitychangein the live charts andhashchangeon the settings page were both registered with anonymous handlers and never removed — anonymous meaning they could not be removed. Both are now named and taken off inonUnmounted, which is whatuseLiveDataalready did and what I should have copied the first time.The practical impact is small on a page mounted once per load, but it is the exact bug I flagged as avoided elsewhere, so it should not stand.
Note for upstream
The underlying
Concurrent_insert_offrule is still wrong for MariaDB — it should skip cleanly on a flavour that reports the variable as a string, rather than failing to evaluate. That belongs in DB Doctor, where the rule comes from; fixing it here would diverge the ported copy and make the next re-sync harder.eslint,php-cs-fixerand psalm clean; the committedjs/cssreproduce from a fresh build.