Skip to content

Conversation

@pedrolamas
Copy link
Member

Disable Moonraker compact, backup, and restore database operations if the printer is currently printing.

Fixes #1738

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas added this to the 1.35.1 milestone Nov 16, 2025
@pedrolamas pedrolamas requested a review from Copilot November 16, 2025 18:25
@pedrolamas pedrolamas added the GH - Bug Something isn't working label Nov 16, 2025
Copilot finished reviewing on behalf of pedrolamas November 16, 2025 18:28
Copy link

Copilot AI left a 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 disabled attribute to restore, compact, and create backup buttons based on printer state
  • Uses printerPrinting property 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"
Copy link

Copilot AI Nov 16, 2025

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:

  1. Database restore operations trigger a socket disconnect (line 124), which would disrupt even a paused print
  2. 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.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@pedrolamas pedrolamas Nov 16, 2025

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"
Copy link

Copilot AI Nov 16, 2025

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.

Suggested change
:disabled="printerPrinting"
:disabled="printerBusy"

Copilot uses AI. Check for mistakes.
Copy link
Member Author

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"
Copy link

Copilot AI Nov 16, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Not necessary

@pedrolamas pedrolamas merged commit b7bbef3 into fluidd-core:develop Nov 16, 2025
10 checks passed
@pedrolamas pedrolamas deleted the pedrolamas/fix-1738 branch November 16, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GH - Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable Moonraker database buttons during printing

1 participant