Don't notify on invisible notifications

When you are active on a task that then becomes private, Phabricator shouldn’t notify you that a notification was discarded, See below screenshot.

This could possibly be silent so its only seen the next time the user opens notifications or possibly not alert at all.

notify

Reproduction Instructions

  1. Become active on a task
  2. Task becomes unavailable to the user (eg: task goes from a public space to a private space)
  3. Activity that occurs on task that would generate a notification

Phabricator Version
Possibly Deploying Phabricator release/2019-07-03/1 from wmf/stable

Here’s how we end up here:

  • You can see object A.
  • Someone updates object A.
  • We push a notifications to your browser, so your menu bar now shows “1”. If you clicked the “1” right now, you’d see a notification, like “Alice changed the title of task A from X to Y.”.
  • Someone hides object A from you.
  • Your browser is still showing “1”. You click the “1”.

At this point, we can’t show the user the notification anymore: they no longer have permission to see the object. We can either:

  • Show the user nothing, which is confusing. They come upstream and report a bug like “menu showed 1, but contained 0 notifications”.
  • Show the user an explicit message explaining why we can’t show them the notification.

It sounds like this behavior isn’t obvious.

This message is not itself a notification, and is not pushed to the client. The “1” is not alerting you that we want to tell you something pointless. This message is shown when we’ve already tried to deliver a message (putting a “1” in your menu), but can no longer show you the content of that message because of a policy change.

How could we reword this message so it would be clear to you that it means “sorry, we can’t actually show you the content of one of the notifications we pushed to you”?