Page MenuHomePhabricator

Success message is shown when there are errors
Open, Needs TriagePublicBUG REPORT

Description

After clicking the Bulk OCR button, the success message is displayed and then immediately below it a bunch of errors:

bulkocr.png (289×486 px, 36 KB)

Only the error messages should be shown.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1229805 had a related patch set uploaded (by Okerekechinweotito; author: Okerekechinweotito):

[mediawiki/extensions/Wikisource@master] Fix Success message is shown when there are errors. Show appropriate notifications based on success/failure status: * All failed: Errors are shown * Partial success: warning with count * Complete success: original success message

https://gerrit.wikimedia.org/r/1229805

@theprotonade @Samwilson GSOC aspirant here. Please I have a question ...
The current behavior is such that the bulk ocr process will continue even if some pages fail, leading to partial transcriptions ( some pages fail while others succeed )
when OCR for a single page fails , should the entire bulk OCR process abort or should it continue to the next pages ? This detail is important to know as it would better inform on how the success and error tooltips should be handled.
In the meantime , I have made a patch that ;

  • only shows the success tooltip only when OCR is successful on all pages
  • shows a tooltip with type warning for partial success
  • shows a tooltip with type error when all Pages fail

Thanks @Okerekechinweotito!

I think cancelling the whole batch when there's any error is probably safer, and generally more likely to be what people want. If there's an error with one page, it's probably something like the thumbnail not being generated or an API being down, and so retrying with other pages will probably also fail. And if not, then the user can just try again. But if they're just getting a string of red warnings it won't inspire confidence.

The warning and error notifications should be persistent, and stay on the screen for the user's reference.

@Samwilson @theprotonade
Thanks for the clarification
I have made requested updates to my patch

Change #1240467 had a related patch set uploaded (by Ypaula; author: Ypaula):

[mediawiki/extensions/Wikisource@master] Fix success notification shown when bulk OCR pages fail

https://gerrit.wikimedia.org/r/1240467

Wasn't sure if it was too early to start contributing, but I've been following this thread and Wikimedia activities for a while. I'm especially interested in the accessibility impact of this project. I submitted a patch for this bug: Gerrit patch #1240467

I also noticed Okerekechinweotito already has a patch up for this. I read through their approach and found it really helpful for understanding the codebase. I submitted my own patch as a learning exercise.

Any feedback welcome!

After discussion with the org admins and mentors, we’re pleased to share that early contributions are welcome for this project. There’s no need to wait until March 16 to start working on code or submitting your microtask patches; feel free to dive in whenever you’re ready.

@Gopavasanth just announced that early contributions are welcome for this project.
I would like to share that I previously submitted a patch addressing this issue - Gerrit Patch #1229805

Hi everyone
My name Hussein Mmbaga (@Ssein) a fullstack developer and a Swahili Wikipedia administrator from Arusha, Tanzania.
I am interested in working on this task as part of my preparation for GSoC 2026. I have already set up MediaWiki locally on Linux with the Wikisource related extensions and have been exploring the Bulk OCR codebase.I would like to work on it and submit a patch for review.

Thank you!

Change #1252657 had a related patch set uploaded (by Ssein; author: Ssein):

[mediawiki/extensions/Wikisource@master] Fix success message shown when there are errors

https://gerrit.wikimedia.org/r/1252657

Hi, I am interested in working on this issue.

I would like to try fixing the success message problem.
Could you please guide me if this task is still available?

@Pujiaa: Hi and welcome! Please https://www.mediawiki.org/wiki/New_Developers, and the patches above, and the comments above - thanks.

Hi, I have worked on this issue and submitted a patch for review.

Gerrit patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikisource/+/1257295

I updated the Bulk OCR workflow so that a success message is not shown when there are failures. Now, if any pages fail during OCR save, an error notification is displayed listing the failed pages; otherwise, a success message is shown.

Thanks!

Change #1257369 had a related patch set uploaded (by SrushtiX; author: SrushtiX):

[mediawiki/extensions/Wikisource@master] [Wikisource] Improve Bulk OCR notification handling

https://gerrit.wikimedia.org/r/1257369

Change #1259211 had a related patch set uploaded (by Noor Riyadh; author: Noor Riyadh):

[mediawiki/extensions/Wikisource@master] Fix success message shown when there are errors (T411157)

https://gerrit.wikimedia.org/r/1259211

I have submitted a patch to address this issue: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikisource/+/1259211. I have modified the logic in BulkOcrWidget.js to ensure the success notification is only shown when there are no failed pages.

Change #1259943 had a related patch set uploaded (by Noor Riyadh; author: Noor Riyadh):

[mediawiki/extensions/Wikisource@master] Fix success message shown when there are errors

https://gerrit.wikimedia.org/r/1259943

Hi, I’m Manvi Kesarwani and I’m interested in GSoC 2026.

I have uploaded a patchset for T411157 to fix the Bulk OCR notifications issue (success message was shown even when some pages fail). The change suppresses the success notification whenever any OCR or save operation fails, so only the relevant error notifications are shown.

Please review the patchset. Feedback and suggestions are welcome—thank you!

Change #1262924 had a related patch set uploaded (by RisXeng; author: RisXeng):

[mediawiki/extensions/Wikisource@master] Fix success message shown when there are errors When pages fail to save during bulk OCR, only error messages should be shown instead of success message.

https://gerrit.wikimedia.org/r/1262924

Change #1263098 had a related patch set uploaded (by Johanny Torres; author: Johanny Torres):

[mediawiki/extensions/Wikisource@master] Fix: Only show success message when all pages are saved; show error if some pages fail

https://gerrit.wikimedia.org/r/1263098

Hi, I'm Johanny and I'm want to start contributing in GSoc 2026.

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikisource/+/1263098

I updated the Bulk OCR workflow to fix the issue where a success message
was shown even if some pages failed to save.

Change #1263619 had a related patch set uploaded (by Atharv1345; author: Atharv1345):

[mediawiki/extensions/Wikisource@master] Fix incorrect success notification in Bulk OCR

https://gerrit.wikimedia.org/r/1263619

Hi i have worked on your issues and i submitted a patch for review for contributing in GSOC 2026 https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikisource/+/1263619

i have fix the bulk OCR workflow , i enjoy to solve the issue thanx for giving a opportunity .

Change #1262035 had a related patch set uploaded (by Pppery; author: Manvi Kesarwani):

[mediawiki/extensions/Wikisource@master] Wikisource Bulk OCR: suppress success toast on failures

https://gerrit.wikimedia.org/r/1262035

Change #1264042 had a related patch set uploaded (by Johanny Torres; author: Johanny Torres):

[mediawiki/extensions/Wikisource@master] Fix Bulk OCR notifications when some pages fail

https://gerrit.wikimedia.org/r/1264042

Hi I’m Yajim a Third year Computer Science Student of University for Development Studies, I've just submitted my proposal for the Bulk OCR project. I'm focusing on the OOUI implementation and fixing the success message logic (T411157) during the bonding period. Looking forward to your feedback!
Thank you.

Change #1265449 had a related patch set uploaded (by Creative Gurus; author: Creative Gurus):

[mediawiki/extensions/Wikisource@master] Wikisource: Fix success message shown when Bulk OCR has errors (T411157)

https://gerrit.wikimedia.org/r/1265449

Creative_Gurus added subscribers: SGill, Formasit-chijoh.

Hi @theprotonade @SGill,

I have submitted a patch for T411157 as part of my GSoC 2026 application for Bulk OCR Improvements (T415145).

Patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikisource/+/1265449

Changes made:

  • Fixed the final notification logic so it no longer shows a generic success message when errors or partial failures occur.
  • Now shows: • Success when everything works • Warning with counts for partial success • Error when all pages fail
  • Made the final notification persistent (autoHide: false)

I have assigned this task to myself (creativegurus) for now. Happy to address any review comments or make improvements.

Thank you!

Hi all @Creative_Gurus, @theprotonade, @SGill, @Pppery, @Samwilson

For transparency: am Hussein Mmbaga the accepted GSoC 2026 contributor for the Bulk OCR Improvement project (T415145) and (T411157) is one of the microtasks within my project scope.

I submitted patch 1252657 in March as part of my application. Since acceptance I have traced the code flow through BulkOcrWidget.js.

I also see task assigned to @Creative_Gurus submitted patch 1265449 and mention the purpose of submition and also there several other contributors submit the patches. I do not want to compete with anyone. My goal is to get this bug fixed correctly by whatever approach the mentors prefer.

Local findings from this week reveiw:

  1. The success notification fires even when all OCR-step calls fail. this.ocrDictionary stays empty, saveOcrResults runs with entries = [], and the first call to saveBatch(0) triggers update-pages-complete immediately with an empty failedPages array. The handler then treats this as success. This is a code path separate from the save-step failures my current patch addresses, and I do not see it covered by any of the related open patches I have reviewed.
  1. BulkOcrWidget.js uses a hardcoded English string for the per-page OCR error notification: mw.notify is called with a backtick template literal instead of mw.msg(). This is an i18n violation. I verified it visually by setting ?uselang=sw on the Index page: the rest of the UI renders in Swahili while these per-page error notifications stay in English. The fix is to add a new message key (wikisource-bulkocr-ocr-failed-for-page) in i18n/en.json, document it in i18n/qqq.json, and register it in extension.json so it is available to JavaScript.
  1. The OOUI notification type 'warning' used in my current Patchset 1 renders as the default white notification, not yellow. The correct value is 'warn'. I verified this by calling mw.notify() directly in the browser console with both values and comparing them visually. I have a small amend ready locally that changes 'warning' to 'warn'

I am holding the Patchset 2 push pending wait for guidance. How would you like me to proceed?

(a) Amend and push Patchset 2 on 1252657 warn fix with OCR-step failure tracking and the hardcoded English i18n fix.

(b) Abandon 1252657 and coordinate with @Creative_Gurus on patch 1265449 to incorporate both the save-step and OCR-step scopes there.

(c) Any another arrangement you suggest.

I am genuinely happy to take any of these paths.

@Ssein As r1265449 doesn't pass CI and hasn't been worked on since submission, I'd say it's okay to continue working on your r1252657 patch and to get it sorted out. It sounds like it might be good to break things up into a few different patches, if there are separate unrelated bugs to fix.

@Creative_Gurus are you okay with Ssein taking this over?

Thank you @Samwilson , @SGill and @theprotonade for the guidance.

I have pushed Patchset 2 of 1252657 which now contains the complete fix:

Notification logic

  • OCR-step failure tracking via this.ocrFailedPages
  • update-pages-complete handler now uses correct parameter substitution
  • OOUI type corrected from 'warning' to 'warn'
  • Per-page red error notifications replaced with one summary notification with actionable text and (x) close button
  • Both success and warning notifications are now persistent so users on slow connections can return to find the result

Cancel-on-first-error

  • this.isCancelled flag halts subsequent batches when any error occurs
  • Prevents wasted API calls when the OCR service is down

i18n fix

  • Hardcoded English string replaced with proper mw.msg() call
  • New message key wikisource-bulkocr-process-failed added to en.json, qqq.json, and extension.json's ResourceModules

@Creative_Gurus, your review would still be very welcome on this patch.

Change #1262035 abandoned by Manvi Kesarwani:

[mediawiki/extensions/Wikisource@master] Wikisource Bulk OCR: suppress success toast on failures

Reason:

abondon

https://gerrit.wikimedia.org/r/1262035