fix(update): keep the output of a failed self-update in the journal

A failure only opened a dialog whose text runs past the screen, and unlike
the success path nothing wrote the build output anywhere, so the line that
names the error was lost as soon as the box was closed.
This commit is contained in:
BlackAngelTV committed 2026-10-07 22:49:00 +02:00
1 parent 3ad11318d9
commit 586e4fd0a8
6 files changed
+21 -7

No files matched your search

+16 -3
View File
@@ -1642,12 +1642,25 @@ void MainWindow::onCoreUpdateCheckFinished(bool hasUpdate, const QString& latest
}
// Called when the background git pull + build finishes. A success hands over to
// the freshly installed binary right away; a failure is reported in a dialog.
// the freshly installed binary right away; a failure is reported in a dialog and
// kept whole in the journal.
void MainWindow::onCoreSelfUpdateFinished(bool success, const QString& message) {
if (!success) {
// A failing build prints far more than a dialog can hold, and the part
// that gets cut is precisely the error line. The journal keeps the whole
// output as a command block, so the Logs screen shows it and the file can
// be sent as it is — without it, a failed update leaves no trace at all
// (the outcome is not a provider command, so nothing else records it).
LogManager& journal = LogManager::instance();
journal.beginCommand(QStringLiteral("maj-app"),
QStringLiteral("mise à jour de l'application"));
journal.endCommand(false, message);
qCWarning(pacmgrUpdate) << "self-update failed, output in" << journal.filePath();
QMessageBox::warning(this, tr("Échec de la mise à jour"),
QString(tr("<p>La mise à jour a échoué :</p><pre>%1</pre>"))
.arg(message.toHtmlEscaped()));
QString(tr("<p>La mise à jour a échoué :</p><pre>%1</pre>"
"<p>Le journal complet est dans <code>%2</code>.</p>"))
.arg(message.toHtmlEscaped(), journal.filePath().toHtmlEscaped()));
return;
}