-
-
Notifications
You must be signed in to change notification settings - Fork 531
fix: disable Moonraker database management while printing #1741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: disable Moonraker database management while printing #1741
Conversation
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds protection against potentially disruptive Moonraker database operations while the printer is actively printing, addressing issue #1738.
- Adds
disabledattribute to restore, compact, and create backup buttons based on printer state - Uses
printerPrintingproperty from StateMixin to determine when to disable operations - Intentionally leaves delete backup operation enabled as it's non-disruptive
| v-bind="attrs" | ||
| icon | ||
| :loading="hasWait(`${$waits.onDatabaseRestore}/${item}`)" | ||
| :disabled="printerPrinting" |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using printerBusy instead of printerPrinting for these database operations. The printerBusy getter includes printing, paused, and busy states, which would be more appropriate since:
- Database restore operations trigger a socket disconnect (line 124), which would disrupt even a paused print
- Database compact and backup operations are intensive and could interfere with a paused print
Using printerBusy would provide better protection for users who have temporarily paused their prints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moonraker currently only disables this if the printer is printing, so we will keep this behavior as is.
Socket disconnect only affects Moonraker, Klipper will be unaffected.
| class="mb-2" | ||
| color="primary" | ||
| :loading="hasWait($waits.onDatabaseCompact)" | ||
| :disabled="printerPrinting" |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using printerBusy instead of printerPrinting for the same reasons as the restore operation - database compacting is an intensive operation that could interfere with a paused print.
| :disabled="printerPrinting" | |
| :disabled="printerBusy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moonraker currently only disables this if the printer is printing, so we will keep this behavior as is.
| class="mb-2" | ||
| color="primary" | ||
| :loading="hasWaitsBy(`${$waits.onDatabasePostBackup}/`)" | ||
| :disabled="printerPrinting" |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using printerBusy instead of printerPrinting for the same reasons as the restore operation - creating a database backup is an intensive operation that could interfere with a paused print.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary
Disable Moonraker compact, backup, and restore database operations if the printer is currently printing.
Fixes #1738