Skip to content

Commit 4cc8ac7

Browse files
electricfacerobertkill
authored andcommitted
fix(recovery): No automatic reboot after rollback
- Directly invoke ConfirmRollback via QDBusInterface, bypassing the proxy. - Extend the timeout for the ConfirmRollback method call to 30 minutes. - Prevent long-running rollbacks from failing due to the default 25-second DBus timeout. fix(recovery): 回滚后没有自动重启 - 通过QDBusInterface直接调用ConfirmRollback,绕过代理 - 延长调用 ConfirmRollback 方法的超时,将超时设置为30分钟 - 避免默认25秒的DBus超时导致长时间回滚失败 Influence: 系统回滚 PMS: BUG-387145
1 parent 94b77c7 commit 4cc8ac7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/dde-abrecovery/recoverydialog.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2019 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: LGPL-3.0-or-later
44

55
#include "recoverydialog.h"
66
#include "backgroundwidget.h"
77
#include "dconfig_helper.h"
8+
#include "common/commondefine.h"
89

910
#include <DLabel>
1011
#include <DFontSizeManager>
@@ -27,6 +28,7 @@
2728
#include <QJsonObject>
2829
#include <QPointer>
2930
#include <QDBusReply>
31+
#include <QDBusInterface>
3032
#include <DIcon>
3133
#include <QLoggingCategory>
3234

@@ -188,7 +190,12 @@ void Manage::doConfirmRollback(bool confirm)
188190
if (confirm) {
189191
qCDebug(logUpdateRecovery) << "User confirmed rollback, updating UI to waiting state";
190192
m_recoveryWidget->updateRestoringWaitUI();
191-
QDBusPendingCall call = m_updateDBusProxy->ConfirmRollback(true);
193+
// ConfirmRollback can take ~30s+, bypass the proxy to set a 30-minute
194+
// timeout and avoid the default ~25s DBus timeout.
195+
QDBusInterface managerIface(ManagerService, ManagerPath, ManagerInterface,
196+
QDBusConnection::systemBus());
197+
managerIface.setTimeout(30 * 60 * 1000);
198+
QDBusPendingCall call = managerIface.asyncCall(QStringLiteral("ConfirmRollback"), true);
192199
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
193200
connect(watcher, &QDBusPendingCallWatcher::finished, [this, watcher] {
194201
QDBusPendingReply<void> reply = *watcher;

0 commit comments

Comments
 (0)