Refined-github: Notifications that are manually "Marked as Unread" gets removed when pressing "Mark all {repository} notifications as read" in another (unrelated) repository

Created on 23 Nov 2018  路  1Comment  路  Source: sindresorhus/refined-github

As the issue title says, notifications that are manually "Marked as Unread" gets removed when pressing "Mark all {repository} notifications as read" in another (unrelated) repository.

To reproduce:

  1. #### Manually mark an issue as unread

image


  1. #### There are now two notifications, one from repo 1 (actually unread), one from repo 2 (manually marked as unread)

image


  1. #### Clicking "mark all {repo} notifications as read" on repo 1
    image

  1. #### All repo 1 notifications are marked as read
    image

  1. #### After refreshing the page, the notifications from repo 2 is also marked as read, but should not be
    image

Expected results

Urelated (in another repo) notifications should not be affected


Specs

Browser: Chrome, Version 70.0.3538.102
Refined Github Extension: Version 18.11.21.1745

bug help wanted

Most helpful comment

Can verify that this is a bug from the RGH side, and the culprit being these lines https://github.com/sindresorhus/refined-github/blob/561af934726cf981743a53417051b306f920cb06/source/features/mark-unread.js#L370-L372


The above lines remove all marked-as-unread-notifications, regardless of the notifications it was supposed to clear. The above code should been something like

  delegate('form[action="/notifications/mark"] button', 'click', ({delegateTarget}) => {
    const group = delegateTarget.closest('.boxed-group');
    const repo = select('.notifications-repo-link', group).textContent;
    storage.set(storage.get().filter(notif => notif.repository != repo));
 })

>All comments

Can verify that this is a bug from the RGH side, and the culprit being these lines https://github.com/sindresorhus/refined-github/blob/561af934726cf981743a53417051b306f920cb06/source/features/mark-unread.js#L370-L372


The above lines remove all marked-as-unread-notifications, regardless of the notifications it was supposed to clear. The above code should been something like

  delegate('form[action="/notifications/mark"] button', 'click', ({delegateTarget}) => {
    const group = delegateTarget.closest('.boxed-group');
    const repo = select('.notifications-repo-link', group).textContent;
    storage.set(storage.get().filter(notif => notif.repository != repo));
 })
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mischah picture mischah  路  3Comments

durka picture durka  路  3Comments

alexanderadam picture alexanderadam  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

shivapoudel picture shivapoudel  路  3Comments