[PR #6456] [MERGED] fix(web): restart panel after ImportDB so subPath routes match (#6446) #6278

Closed
opened 2026-11-02 04:07:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6456
Author: @mrchatam
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/13/2026
Merged by: @MHSanaei

Base: main ← Head: fix/importdb-restart-panel


📝 Commits (2)

  • 0d7d1ea fix(web): restart panel after ImportDB so subPath routes match (#6446)
  • c8a5a10 fix(web): schedule the post-import panel restart once, via PanelService

📊 Changes

3 files changed (+97 additions, -7 deletions)

View changed files

📝 frontend/src/pages/index/BackupModal.tsx (+3 -7)
➕ internal/web/controller/import_db_restart_test.go (+91 -0)
📝 internal/web/controller/server.go (+3 -0)

📄 Description

Summary

  • After a successful ImportDB (SQLite and PostgreSQL paths), schedule an in-process panel restart via global.TriggerRestart (same path as restartPanel / PanelService.RestartPanel), with the existing SIGHUP fallback.
  • Fixes subscription 404 after database restore when subPath (and related startup-registered routes) change in the DB but the subscription listener was never rebuilt (#6446).
  • Does not change hostBoundSettingKeys membership.

Why

ImportDB previously restarted Xray only. The UI follow-up to /panel/api/setting/restartPanel can silently fail when the imported users table invalidates the session, leaving the subscription server on old routes while the panel shows the restored path.

Test plan

  • Clean install → import a DB whose subPath differs from the fresh default → without a manual x-ui restart, the copied subscription URL (restored path) should succeed after the automatic panel restart.
  • Confirm import still returns success and Xray comes back up.
  • With “Keep this machine’s settings” checked, host-bound listen/cert settings remain those of the destination machine.

Closes #6446


🔄 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/MHSanaei/3x-ui/pull/6456 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 9/11/2026 **Status:** ✅ Merged **Merged:** 9/13/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/importdb-restart-panel` --- ### 📝 Commits (2) - [`0d7d1ea`](https://github.com/MHSanaei/3x-ui/commit/0d7d1ea7fbe6ebeb19d1a2c6509dfa24a574597c) fix(web): restart panel after ImportDB so subPath routes match (#6446) - [`c8a5a10`](https://github.com/MHSanaei/3x-ui/commit/c8a5a10c1a8091fecd3754762e3308e59fc239d8) fix(web): schedule the post-import panel restart once, via PanelService ### 📊 Changes **3 files changed** (+97 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/index/BackupModal.tsx` (+3 -7) ➕ `internal/web/controller/import_db_restart_test.go` (+91 -0) 📝 `internal/web/controller/server.go` (+3 -0) </details> ### 📄 Description ## Summary - After a successful `ImportDB` (SQLite and PostgreSQL paths), schedule an in-process panel restart via `global.TriggerRestart` (same path as `restartPanel` / `PanelService.RestartPanel`), with the existing SIGHUP fallback. - Fixes subscription `404` after database restore when `subPath` (and related startup-registered routes) change in the DB but the subscription listener was never rebuilt (#6446). - Does not change `hostBoundSettingKeys` membership. ## Why `ImportDB` previously restarted Xray only. The UI follow-up to `/panel/api/setting/restartPanel` can silently fail when the imported `users` table invalidates the session, leaving the subscription server on old routes while the panel shows the restored path. ## Test plan - [ ] Clean install → import a DB whose `subPath` differs from the fresh default → without a manual `x-ui restart`, the copied subscription URL (restored path) should succeed after the automatic panel restart. - [ ] Confirm import still returns success and Xray comes back up. - [ ] With “Keep this machine’s settings” checked, host-bound listen/cert settings remain those of the destination machine. Closes #6446 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:37 +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
MHSanaei/3x-ui#6278
No description provided.