Skip to content

WebPlatform.ts: Notifications do not disappear when user focuses window #16026

@amstan

Description

@amstan

Description

Steps to reproduce

  • Get notification
  • Don't click it!
  • Get to the tab with element manually
  • Expected: Notification disappears
  • Actual: Notification happily stays up while you're trying a reply to message that initialy causes said notification

For the web app:

  • Platform: web
  • Browser: Version 87.0.4280.66 (Official Build) (64-bit)
  • OS: Arch Linux + KDE
  • URL: app.element.io

I suspected this being a problem by just using the app, but I pretty much guaranteed it when looking at the code:

Even though I'm not a web developer by trade right now, window.Notifications does seem to have a .close() method, we don't seem to call it:

  1. https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/Notifier.ts#L371 is supposed to close it, but
  2. https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/Notifier.ts#L126 is not executed, because
  3. https://github.com/vector-im/element-web/blob/develop/src/vector/platform/WebPlatform.ts#L75 didn't return it
  4. unlike electron: https://github.com/vector-im/element-web/blob/develop/src/vector/platform/ElectronPlatform.tsx#L370

PS: There is one possible last if that could mess with this, together with a note that not all browsers support .close(): https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/BasePlatform.ts#L166, mine isn't one of those

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions