[PR #5627] [MERGED] fix: keep staged profile imports until completion #6855

Closed
opened 2026-10-23 04:14:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5627
Author: @SpicyMarinara
Created: 8/29/2026
Status: ✅ Merged
Merged: 8/29/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/5624-profile-preview-lifetime


📝 Commits (1)

  • 6a63e0c fix(import): keep profile previews until completion

📊 Changes

3 files changed (+23 additions, -35 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/routes/backup.routes.ts (+10 -29)
📝 scripts/regressions/profile-import-data-security.regression.ts (+12 -6)

📄 Description

Linked issue

Closes #5624

Why this change

  • The single-upload profile import still deleted its staged archive 30 minutes after preview.
  • A user who reviewed or paused beyond that arbitrary deadline had to upload a multi-gigabyte profile again, recreating the original failure mode.

What changed

  • Remove the staged-profile timestamp, expiry check, and periodic expiry timer.
  • Keep the one-time import token valid until Import consumes it, Cancel deletes it, or the server shuts down/restarts.
  • Preserve cleanup on every terminal path and keep tokens single-use.
  • Add a regression that advances the clock past the former 30-minute boundary before confirming an empty-body import.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • pnpm check
  • Focused profile-import-data-security.regression.ts: preview token remains valid after simulated 31-minute delay, confirmation has no upload body, restored asset matches, and replay returns 410

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Behavior-only lifecycle correction; no layout, styling, or user-facing UI copy changed.

Summary by CodeRabbit

  • Bug Fixes

    • Profile import previews remain available until they are imported, canceled, or the server shuts down.
    • Previews can now be used after more than 30 minutes without resubmitting the original upload.
    • Improved messaging when a preview is no longer available.
  • Documentation

    • Updated the changelog to document the revised preview retention behavior.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5627 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/29/2026 **Status:** ✅ Merged **Merged:** 8/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5624-profile-preview-lifetime` --- ### 📝 Commits (1) - [`6a63e0c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6a63e0c63850fda2857d0149208a64aa8df5f672) fix(import): keep profile previews until completion ### 📊 Changes **3 files changed** (+23 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/routes/backup.routes.ts` (+10 -29) 📝 `scripts/regressions/profile-import-data-security.regression.ts` (+12 -6) </details> ### 📄 Description ## Linked issue Closes #5624 ## Why this change - The single-upload profile import still deleted its staged archive 30 minutes after preview. - A user who reviewed or paused beyond that arbitrary deadline had to upload a multi-gigabyte profile again, recreating the original failure mode. ## What changed - Remove the staged-profile timestamp, expiry check, and periodic expiry timer. - Keep the one-time import token valid until Import consumes it, Cancel deletes it, or the server shuts down/restarts. - Preserve cleanup on every terminal path and keep tokens single-use. - Add a regression that advances the clock past the former 30-minute boundary before confirming an empty-body import. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `pnpm check` - Focused `profile-import-data-security.regression.ts`: preview token remains valid after simulated 31-minute delay, confirmation has no upload body, restored asset matches, and replay returns 410 ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Behavior-only lifecycle correction; no layout, styling, or user-facing UI copy changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Profile import previews remain available until they are imported, canceled, or the server shuts down. * Previews can now be used after more than 30 minutes without resubmitting the original upload. * Improved messaging when a preview is no longer available. * **Documentation** * Updated the changelog to document the revised preview retention behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6855
No description provided.