Skip to content

fix(server): Persist auto increase storage disable on DB servers (backport #6691)#6695

Merged
regdocs merged 2 commits into
masterfrom
mergify/bp/master/pr-6691
Jun 11, 2026
Merged

fix(server): Persist auto increase storage disable on DB servers (backport #6691)#6695
regdocs merged 2 commits into
masterfrom
mergify/bp/master/pr-6691

Conversation

@mergify

@mergify mergify Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

configure_auto_add_storage is always dispatched on the app server from the dashboard ($appServer), with the real target passed as the server argument. The enable branch routed to the right doc via server, but the disable branch hardcoded self, so disabling on a DB/replication server cleared the flag on the app server instead. The target server kept auto_increase_storage = True and the checkbox reverted on reload.

Resolve the target doc once and use it in both branches.


This is an automatic backport of pull request #6691 done by Mergify.

regdocs and others added 2 commits June 11, 2026 11:39
`configure_auto_add_storage` is always dispatched on the app server from
the dashboard ($appServer), with the real target passed as the `server`
argument. The enable branch routed to the right doc via `server`, but the
disable branch hardcoded `self`, so disabling on a DB/replication server
cleared the flag on the app server instead. The target server kept
`auto_increase_storage = True` and the checkbox reverted on reload.

Resolve the target doc once and use it in both branches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 426eda0)
`configure_auto_add_storage` resolves the target via `frappe.get_doc` from
the attacker-controllable `server` argument, but the dashboard API only
team-checks `self` (the app server). The disable path writes via
`frappe.db.set_value`, which skips permission hooks, so any Press User could
flip `auto_increase_storage` off on another team's Database Server by passing
its name. (The enable path was already covered by `save()`'s write hook.)

Add an explicit `server_doc.check_permission("write")` after resolving the
target — guards both branches without giving up `set_value`'s cheap,
side-effect-free single-field write on the disable path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 6fab297)
@mergify mergify Bot requested a review from adityahase as a code owner June 11, 2026 11:39
@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Target branch is in the excluded branches list.

@codecov-commenter

codecov-commenter commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.51%. Comparing base (242aef1) to head (96c302e).

Files with missing lines Patch % Lines
press/press/doctype/server/server.py 42.85% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6695       +/-   ##
===========================================
- Coverage   90.92%   50.51%   -40.41%     
===========================================
  Files         117      994      +877     
  Lines       18085    83737    +65652     
  Branches      676      526      -150     
===========================================
+ Hits        16443    42301    +25858     
- Misses       1607    41404    +39797     
+ Partials       35       32        -3     
Flag Coverage Δ
dashboard 62.88% <ø> (-28.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@regdocs regdocs merged commit c93c978 into master Jun 11, 2026
12 of 13 checks passed
@regdocs regdocs deleted the mergify/bp/master/pr-6691 branch June 11, 2026 11:58
@frappe-pr-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 0.42.7 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants