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 );

notification-bug.png (342×1 px, 74 KB)

Event Timeline

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 triaged this task as Unbreak Now! priority.

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

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