jenkins-bot has submitted this change and it was merged.

Change subject: Mark all notifications in a foreign bundle as read
......................................................................


Mark all notifications in a foreign bundle as read

Foreign notifications, though non-expandable, can represent
bundles (4 new topics on your talk page). When marking one
as read, it's important to provide all the IDs that are
part of that bundle. Otherwise, only the dynamic base is
marked as read and the bundle shows up again on reload
(3 new topics on your talk page).

For bundles that do not include the count
(The description on Flow_Page was edited multiple times)
it looks like the mark-as-read action did not work.

Tagging with T140309 as it may explain it but not 100% sure.

Bug: T140309
Change-Id: I19c9eb18669b7cad8173c966392a6e5977018121
---
M modules/controller/mw.echo.Controller.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/controller/mw.echo.Controller.js 
b/modules/controller/mw.echo.Controller.js
index d8ccbe8..3544e1d 100644
--- a/modules/controller/mw.echo.Controller.js
+++ b/modules/controller/mw.echo.Controller.js
@@ -629,6 +629,7 @@
        mw.echo.Controller.prototype.markCrossWikiItemsRead = function ( 
itemIds, source ) {
                var sourceModel,
                        notifs,
+                       allIds = [],
                        xwikiModel = this.manager.getNotificationModel( 'xwiki' 
);
 
                if ( !xwikiModel ) {
@@ -644,7 +645,10 @@
                // Update pagination count
                this.manager.updateCurrentPageItemCount();
 
-               return this.api.markItemsRead( itemIds, source, true )
+               notifs.forEach( function ( notif ) {
+                       allIds = allIds.concat( notif.getAllIds() );
+               } );
+               return this.api.markItemsRead( allIds, source, true )
                        .then( this.refreshUnreadCount.bind( this ) );
        };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/302817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I19c9eb18669b7cad8173c966392a6e5977018121
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Sbisson <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to