Conversation
Validate selected components before restoration, bound archive and JSON processing, and reject overlapping backup tasks. Stream database dumps and move export JSON processing into worker threads. Include the API contract, generated client types, English diagnostic messages, and regression coverage. Validation: 165 backup tests passed; Ruff and git diff checks passed.
Allow users to choose backup and restore components, show dependency warnings and stage progress, and retain restored scope and warnings on failure. Update the API wrapper and all four locale files. Validation: vue-tsc --noEmit, locale JSON parsing, and git diff checks passed.
Regenerate the tracked MDI subset from current sources to include the checkbox-multiple-marked and database-refresh icons used by the backup dialog.
Include ijson in pip requirements as well as pyproject.toml, and document selective backup and restoration in both WebUI guides. Validation: docs build, Ruff, and dependency specification checks passed.
Contributor
There was a problem hiding this comment.
Sorry @RC-CHN, your pull request is larger than the review limit of 150,000 diff characters
Revert 90f416c so generated icon CSS and font binaries are excluded from this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full backups currently bundle every component, and restoration offers no way to recover only part of an instance. This adds explicit export and restore scopes while bounding JSON processing for large database dumps.
Modifications / 改动点
Add component selection to the backup API and WebUI, covering the main database, knowledge bases, configuration, attachments, plugin directories/data, and the other existing backup directories. Omitted API component selections retain the full-backup behavior.
Group export and restore selections into Main Data, Plugins & Extensions, and Temporary Files, with expandable descriptions, group checkboxes, partial-selection states, and counts. Export selects the first two groups by default; temporary files are opt-in. Restore selects all available items, explains unavailable entries, and summarizes the data to be replaced. Refine typography, spacing, checkbox alignment, and mobile layouts.
Verify selected components before modifying data, including entry and component checksums, missing entries, JSON structure, and model validation. Keep main database replacement and KB metadata replacement transactional; clear KB files only after the metadata transaction succeeds.
Stream database dumps with
ijson, bound ZIP metadata/expanded size and JSON records, and move export JSON work and compression into worker threads. Validate raw JSON before materializing containers and preserve NUL/UTF-8 text during bounded database reads.Reject overlapping backup/restore tasks. Show component progress, warnings, and restored scope after partial failures; derive KB manifest inventory from entries actually written.
Update OpenAPI and generated client types, all four UI locales and English diagnostics. Add
ijson>=3.4,<4to both Python dependency files and update the English/Chinese WebUI guides.This is NOT a breaking change. / 这不是一个破坏性变更。
Compatibility is not unconditional: selective archives require an importer supporting component selection, and the new resource limits can reject oversized legacy backups. Limits include 8 MiB per JSON record, nesting depth 64, 2 GiB for main/KB metadata dumps, 256 MiB per KB document dump, 8 MiB for the manifest, and 32 GiB total expanded archive size. Import verification intentionally runs synchronously and can temporarily delay dashboard responses.
Screenshots or Test Results / 运行截图或测试结果
Automated verification:
tests/test_backup.pyandtests/test_backup_resources.py): 165 tests passed, including targeted reruns after updating diagnostic-message assertions. Three existing warnings remain (audioopdeprecation and two chunk-upload cleanup coroutine warnings).ruff format .,ruff check ., andgit diff --check: passed.vue-tsc --noEmit: passed; all four changed locale JSON files parsed successfully.cd docs && pnpm run docs:build: passed, with a bundle-size warning.Regression coverage includes selective/legacy restoration, preflight rejection before writes, database rollback, oversized archive/JSON rejection, bounded streaming with native and Python parser backends, large integers, NUL/Unicode round trips, export cancellation, single-task admission, and restoring database plus attachments in two parsing passes.
The
Settings → Maintenanceentry point is unchanged. The English and Chinese WebUI guides now describe the three expandable groups, export defaults, unavailable restore items, replacement scope, attachment dependencies, and import responsiveness. These guide sections contain no screenshots to replace.Checklist / 检查清单
docs/zhanddocs/enand updated them in this PR. No navigation entry was renamed, moved, or merged, so an old-to-new mapping is not applicable.requirements.txtandpyproject.toml.