Page MenuHomePhabricator

Speedy form message flow is fundamentally broken
Open, HighPublic

Description

There are actually multiple issues, but let's start with most significant one:

on line 200 of speedyform.cpp we are messaging the author of the page edit instead of actual page creator:

if (this->ui->cbSendWarning->isChecked())
{
    QString summary = this->edit->GetSite()->GetProjectConfig()->SpeedyWarningSummary;
    summary.replace("$1", this->edit->Page->PageName);
    this->warning.replace("$1", this->edit->Page->PageName);
    WikiUtil::MessageUser(this->edit->User, this->warning, "", summary, false); // this is wrong
}
this->timer->stop();
this->ui->pushButton->setText(_l("speedy-finished"));

we need to figure out the page creator and message that one instead

Another issue I found is that there is missing callback in case that edit query fails (~line 122) we only handle successull change, and ignore failure, that would most likely result in form being stuck disabled in foreground.

Then there is a problem with success callback - we close the form assuming we are done here, but in fact that's only when we finish editing the page, we still need to message the user (which we do), I think only reason why this doesn't crash Huggle is that Qt is smart enough and deletes the form from memory only when it's no longer active (the timer is running until message is delivered).

Also the timer solution is ugly and comes from history before ApiQuery supported callbacks, we should probably redo the whole flow using callbacks instead of timer, but that's not so important.

Event Timeline

Petrb triaged this task as High priority.Oct 14 2021, 9:17 AM
Petrb created this task.