Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

morebits: fix handling of hard errors #1651

Merged
merged 1 commit into from Oct 26, 2022
Merged

morebits: fix handling of hard errors #1651

merged 1 commit into from Oct 26, 2022

Conversation

siddharthvp
Copy link
Member

@siddharthvp siddharthvp commented Oct 21, 2022

In #1179, support for new error formats were added and used by default. However, the error handling code still assumes the legacy errorformat, which passes details of the first error, while in the newer ones we have an array errors.

Notes for testing:
On testwiki, add text "Trigger abuse filter warn" to any page (it triggers https://test.wikipedia.org/wiki/Special:AbuseFilter/256):

var p = new Morebits.wiki.page('SD0001test', '');
p.setAppendText('trigger abuse filter warn');
p.setEditSummary('edit summary');
p.append();

Without this patch, we get:
Screenshot 2022-10-21 at 11 03 53 PM

The TypeError prevents any failure handling callback from running (one of the reasons why the callback approach is sub-optimal and we should be using promises everywhere).

@github-actions github-actions bot added the Module: morebits The morebits.js library label Oct 21, 2022
In #1179, support for new error formats were added and used by default. However, the error handling code still assumes the legacy errorformat, which passes details of the first `error`, while in the newer ones we have an array `errors`.
@siddharthvp
Copy link
Member Author

Originally reported by User:Sdkb at https://en.wikipedia.org/wiki/User_talk:SD0001/DYK-helper#Bug:_Loses_nomination_when_edit_filter_triggered (DYK-helper uses morebits)

@siddharthvp siddharthvp merged commit ecb0f9c into master Oct 26, 2022
@siddharthvp siddharthvp deleted the morebits-errors branch October 26, 2022 12:48
@siddharthvp
Copy link
Member Author

Merged; clear-cut bug affecting users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Module: morebits The morebits.js library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant