Page MenuHomePhabricator

Marking notification as read causes "TypeError: sourceModel is null"
Closed, ResolvedPublic

Description

This JavaScript error happened right after I clicked on mark as read in the popup:

{
	"errorMessage": "TypeError: sourceModel is null",
	"url": "https://pt.wikipedia.org/w/load.php?debug=false&lang=pt&modules=ext.echo.controller%2Cdm%2Clogger%2Cui%7Cext.echo.styles.badge%2Cnotifications%7Cext.echo.ui.desktop%7Cmoment%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui-core.styles%7Coojs-ui.styles.icons%2Cicons-alerts%2Cicons-content%2Cicons-interactions%2Cicons-user%2Cindicators%2Ctextures%7Cschema.EchoInteraction&skin=vector&version=4377d2b7cb99",
	"lineNumber": 8,
	"columnNumber": 808,
	"errorObject": {}
}

in debug mode I get this:

{
	"errorMessage": "TypeError: sourceModel is null",
	"url": "https://pt.wikipedia.org/w/extensions/Echo/modules/controller/mw.echo.Controller.js?d173b",
	"lineNumber": 487,
	"columnNumber": 3,
	"errorObject": {}
}

from this part of the code:

		sourceModel = xwikiModel.getList().getGroupBySource( modelName );
		notifs = sourceModel.findByIds( itemIds );
		sourceModel.discardItems( notifs );

Event Timeline

He7d3r created this task.Jun 30 2016, 9:00 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 30 2016, 9:00 PM
He7d3r renamed this task from Marking notification as read causes to Marking notification as read causes "TypeError: sourceModel is null".Jun 30 2016, 9:00 PM
He7d3r updated the task description. (Show Details)
He7d3r updated the task description. (Show Details)
Catrope assigned this task to Mooeypoo.Jul 1 2016, 1:29 PM
Catrope triaged this task as Unbreak Now! priority.
Restricted Application added subscribers: Luke081515, TerraCodes, Urbanecm. · View Herald TranscriptJul 1 2016, 1:29 PM

Stack trace in betalabs for clicking on <span class="oo-ui-labelElement-label mw-echo-ui-menuItemWidget-content-label">Marca com a llegit</span>

TypeError: sourceModel is null
mw.echo.Controller.prototype.markCrossWikiItemsRead()
mw.echo.Controller.prototype.markSingleItemRead()
mw.echo.ui.SingleNotificationItemWidget.prototype.markRead()
mw.echo.ui.NotificationItemWidget.prototype.onPopupButtonWidgetChoose()
oo.EventEmitter.prototype.emit()
OO.ui.SelectWidget.prototype.chooseItem()
OO.ui.MenuSelectWidget.prototype.chooseItem()
OO.ui.SelectWidget.prototype.onMouseUp()
bound ()

Change 296958 had a related patch set uploaded (by Catrope):
Fix JS error when marking foreign notifications as read

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

Catrope claimed this task.Jul 1 2016, 7:47 PM
Catrope added a subscriber: Mooeypoo.

Change 297262 had a related patch set uploaded (by Sbisson):
Fix mark xwiki as read

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

Change 297262 merged by jenkins-bot:
Fix mark xwiki as read

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

Change 296958 abandoned by Sbisson:
Fix JS error when marking foreign notifications as read

Reason:
The other fix was merged.

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

Quiddity lowered the priority of this task from Unbreak Now! to High.Jul 13 2016, 8:49 PM

Checked the fix in betalabs.

jmatazzoni closed this task as Resolved.Jul 20 2016, 9:02 PM