Skip to content

frontend: update axios version#3605

Merged
patrickelectric merged 1 commit intobluerobotics:masterfrom
nicoschmdt:update-axios
Oct 20, 2025
Merged

frontend: update axios version#3605
patrickelectric merged 1 commit intobluerobotics:masterfrom
nicoschmdt:update-axios

Conversation

@nicoschmdt
Copy link
Contributor

@nicoschmdt nicoschmdt commented Oct 16, 2025

fix: #2605

The major change is that CancelTokenSource was deprecated.

Tested:

  • Deleting System Log Files through Menu;
  • Canceling System Log Files deletion mid-way;
  • Viewing installed extension logs;
  • Forgetting Wifi connection;
  • Changing Wifi connection;
  • Changing BlueOS version.

Summary by Sourcery

Upgrade axios to version 1.12.2, migrate from deprecated CancelToken API to AbortController, and adjust progress event handling across frontend components to ensure compatibility.

Enhancements:

  • Replace axios CancelToken usage with AbortController signals in log and deletion controllers
  • Update onDownloadProgress handlers to use the event property for progress reporting
  • Refactor KrakenManager.getContainerLogs to accept AbortSignal instead of CancelToken
  • Bump axios dependency to ^1.12.2 in package.json

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 16, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Upgraded axios to v1.x by replacing the deprecated CancelToken API with AbortController/AbortSignal, updating progress event handling to the new event shape, and bumping the dependency version.

Class diagram for updated log and deletion controllers

classDiagram
    class ExtensionManagerView {
        - log_abort_controller: AbortController | null
        + showLogs(extension: InstalledExtensionData)
    }
    class SettingsMenu {
        - deletion_log_abort_controller: AbortController | null
        + remove_service_log_files(): Promise<void>
    }
    ExtensionManagerView --> "1" AbortController
    SettingsMenu --> "1" AbortController
Loading

Class diagram for updated getContainerLogs function signature

classDiagram
    class KrakenManager {
        + getContainerLogs(containerName: string, progressHandler: (event: any) => void, cancelToken: AbortSignal | undefined): Promise<any>
    }
    KrakenManager --> "1" AbortSignal
Loading

File-Level Changes

Change Details Files
Migrate from CancelTokenSource to AbortController for request cancellation
  • Removed CancelTokenSource import and replaced controller type with AbortController
  • Instantiated controllers via new AbortController()
  • Replaced .cancel() calls with .abort()
  • Swapped cancelToken properties to signal in axios request configs
core/frontend/src/views/ExtensionManagerView.vue
core/frontend/src/components/app/SettingsMenu.vue
core/frontend/src/components/kraken/KrakenManager.ts
Adjust onDownloadProgress and related handlers to use the new event wrapper
  • Changed handleDownloadProgress calls to pass progressEvent.event
  • Updated handleLogProgress invocations to use progressEvent.event
  • Modified streaming response parsing to access response via progressEvent.event.currentTarget.response
  • Updated digestNewData calls to use progressEvent.event
core/frontend/src/views/ExtensionManagerView.vue
core/frontend/src/components/app/SettingsMenu.vue
core/frontend/src/components/cloud/CloudTrayMenu.vue
core/frontend/src/components/version-chooser/VersionChooser.vue
Bump axios dependency to latest version
  • Updated axios version in package.json from ^0.21.1 to ^1.12.2
core/frontend/package.json

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 there - I've reviewed your changes - here's some feedback:

  • Consider abstracting the repetitive progressEvent.event extraction into a small helper or axios interceptor so your download/log handlers can work directly with raw events and improve readability.
  • You may want to centralize AbortController setup and teardown (e.g. via a shared mixin or composable) to ensure consistent cancellation logic and avoid boilerplate across multiple components.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider abstracting the repetitive `progressEvent.event` extraction into a small helper or axios interceptor so your download/log handlers can work directly with raw events and improve readability.
- You may want to centralize AbortController setup and teardown (e.g. via a shared mixin or composable) to ensure consistent cancellation logic and avoid boilerplate across multiple components.

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.

@patrickelectric patrickelectric merged commit e9e8651 into bluerobotics:master Oct 20, 2025
7 checks passed
@nicoschmdt nicoschmdt deleted the update-axios branch October 28, 2025 20:08
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.

core: frontend: Update axios to use more recent version

2 participants

Comments