Skip to content

fix: Backup feature Chunk load error#1462

Open
sub-hub wants to merge 2 commits into
kwaroran:mainfrom
sub-hub:fixpreloadError
Open

fix: Backup feature Chunk load error#1462
sub-hub wants to merge 2 commits into
kwaroran:mainfrom
sub-hub:fixpreloadError

Conversation

@sub-hub
Copy link
Copy Markdown
Collaborator

@sub-hub sub-hub commented May 25, 2026

PR Checklist

  • Required Checks
    • Have you added type definitions?
    • Have you tested your changes?
    • Have you checked that it won't break any existing features?
  • If your PR uses models1, check the following:
    • Have you checked if it works normally in all models?
    • Have you checked if it works normally in all web, local, and node-hosted versions? If it doesn't, have you blocked it in those versions?
  • If your PR is highly AI generated2, check the following:
    • Have you understood what the code does?
    • Have you cleaned up any unnecessary or redundant code?
    • Is it not a huge change?
      • We currently do not accept highly AI generated PRs that are large changes.

Summary

image

Currently, An error occurs when trying to perform a backup after restart the web risu server.
The dynamic import streamsaver package does not work until reload the page because the address changes.

So I changed streamsaver import in LocalWriter to a static import for reliability (prevents backup failures if server restarts).
And added a global handler in main.ts for Vite’s vite:preloadError event. If a dynamic import fails (e.g., after server update), users are alerted that they needs to refresh the page.
There are other dynamic imports remaining, but I'm leaving them as is since they aren't important enough to convert to static.

Footnotes

  1. Modifies the behavior of prompting, requesting, or handling responses from AI models.

  2. Over 80% of the code is AI generated.

@sub-hub sub-hub changed the title fix: Backup not working after web risu server update fix: Backup feature Chunk load error May 25, 2026
Copy link
Copy Markdown
Collaborator

@cubicj cubicj left a comment

Choose a reason for hiding this comment

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

Verified the backup export path and preload-error handling. Making streamsaver a static import removes the late chunk load from LocalWriter, and the global preload handler gives users a clear refresh path for remaining stale chunks.

Check, tests, and build pass locally.

Approving — thanks for the contribution!

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.

2 participants