Skip to content

core: frontend: SettingsView: Prevent system log delete while downloading#3782

Open
patrickelectric wants to merge 1 commit intobluerobotics:masterfrom
patrickelectric:fix4
Open

core: frontend: SettingsView: Prevent system log delete while downloading#3782
patrickelectric wants to merge 1 commit intobluerobotics:masterfrom
patrickelectric:fix4

Conversation

@patrickelectric
Copy link
Member

@patrickelectric patrickelectric commented Feb 10, 2026

Closes #3284

Summary by Sourcery

Prevent system logs from being deleted while a log download is in progress by tracking download state and disabling relevant actions accordingly.

Bug Fixes:

  • Disable the system log deletion action while a log download is in progress to avoid concurrent operations on the same logs.

Enhancements:

  • Track the system log download state in the settings view and disable the download button during active downloads.

…ding

Disable delete button during download and download button during
deletion to prevent corrupt or failed log operations.

Closes bluerobotics#3284

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Feb 10, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Prevents users from deleting system logs while they are being downloaded by tracking download state and wiring it into the log download and delete controls.

Sequence diagram for system log download and guarded deletion

sequenceDiagram
  actor User
  participant SettingsView
  participant filebrowser

  User->>SettingsView: click download_service_log_files
  SettingsView->>SettingsView: set downloading = true
  SettingsView->>filebrowser: fetchFolder(system_logs)
  filebrowser-->>SettingsView: Folder
  SettingsView->>filebrowser: downloadFolder(Folder)
  filebrowser-->>SettingsView: Download complete
  SettingsView->>SettingsView: set downloading = false

  User->>SettingsView: click remove_service_log_files
  SettingsView->>SettingsView: Check disable_remove, deletion_in_progress, downloading
  SettingsView-->>User: Button disabled if any flag is true
  SettingsView->>SettingsView: If enabled, start deletion (set deletion_in_progress = true)
Loading

Class diagram for SettingsView state and methods related to log download and deletion

classDiagram
  class SettingsView {
    // data
    boolean deletion_in_progress
    boolean downloading
    boolean disable_remove

    // methods
    async download_service_log_files()
    async remove_service_log_files()
  }

  class filebrowser {
    async fetchFolder(name)
    async downloadFolder(folder)
  }

  SettingsView --> filebrowser: uses
Loading

File-Level Changes

Change Details Files
Introduce a downloading state flag and use it to guard log download and delete actions.
  • Add a reactive downloading boolean flag to the SettingsView component state.
  • Wrap the system log download flow in a try/finally block that toggles the downloading flag before and after the operation.
  • Bind the deleting and downloading state flags into the buttons’ :disabled expressions so that download is blocked during deletion and delete is blocked during downloads.
core/frontend/src/views/SettingsView.vue

Assessment against linked issues

Issue Objective Addressed Explanation
#3284 Prevent users from deleting system logs while a system log download is in progress, to avoid failed or partial downloads.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider also disabling the download button when downloading is true (e.g. :disabled="deletion_in_progress || downloading") to prevent multiple concurrent download requests via repeated clicks.
  • If remove_service_log_files can be triggered from anywhere other than this button, it may be safer to add a runtime guard (e.g. early return when this.downloading is true) so that deletions cannot start while a download is in progress even if the UI constraint is bypassed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider also disabling the download button when `downloading` is true (e.g. `:disabled="deletion_in_progress || downloading"`) to prevent multiple concurrent download requests via repeated clicks.
- If `remove_service_log_files` can be triggered from anywhere other than this button, it may be safer to add a runtime guard (e.g. early return when `this.downloading` is true) so that deletions cannot start while a download is in progress even if the UI constraint is bypassed.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nicoschmdt
Copy link
Contributor

Since the download is handled by the browser I can still download the logs and delete them at the same time

image

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.

bug: User can delete system logs after triggering download

2 participants

Comments