fix(flame): avoid double-fail assert in file resolving (#5043)

This commit is contained in:
Alexandru Ionut Tripon 2026-02-17 20:15:48 +00:00 committed by GitHub
commit b20aa9a35c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,7 @@ void Flame::FileResolvingTask::executeTask()
m_task = flameAPI.getFiles(fileIds, m_result.get());
auto step_progress = std::make_shared<TaskStepProgress>();
connect(m_task.get(), &Task::finished, this, [this, step_progress]() {
connect(m_task.get(), &Task::succeeded, this, [this, step_progress]() {
step_progress->state = TaskStepState::Succeeded;
stepProgress(*step_progress);
netJobFinished();
@ -157,7 +157,7 @@ void Flame::FileResolvingTask::netJobFinished()
m_task = modrinthAPI.currentVersions(hashes, "sha1", m_result.get());
(dynamic_cast<NetJob*>(m_task.get()))->setAskRetry(false);
auto step_progress = std::make_shared<TaskStepProgress>();
connect(m_task.get(), &Task::finished, this, [this, step_progress]() {
connect(m_task.get(), &Task::succeeded, this, [this, step_progress]() {
step_progress->state = TaskStepState::Succeeded;
stepProgress(*step_progress);
QJsonParseError parse_error{};
@ -203,6 +203,7 @@ void Flame::FileResolvingTask::netJobFinished()
connect(m_task.get(), &Task::failed, this, [this, step_progress](QString reason) {
step_progress->state = TaskStepState::Failed;
stepProgress(*step_progress);
getFlameProjects();
});
connect(m_task.get(), &Task::stepProgress, this, &FileResolvingTask::propagateStepProgress);
connect(m_task.get(), &Task::progress, this, [this, step_progress](qint64 current, qint64 total) {