Skip to content

[Pusher] Rewrite the whole thing #404

@tobyzerner

Description

@tobyzerner

From @tobscure on August 27, 2015 13:51

I threw the Pusher extension together in a night without much thought, because I wanted to get the beta out the door :P

While it does the basics OK (update the discussion list, push new posts, and update the unread notifications count), it could be way better. And it's a mess and basically needs to be rewritten. Anyway, here's how I think it should be improved:

  • Extract a lot of the code into core, so that the extension is effectively telling core "hey I just found out about this new post in this discussion – whatchu gunna do about it?" and then core shows the "1 updated discussions" button or updates the post stream or whatever. This will allow us to write other extensions for different push services without duplicating/having inconsistent implementations.
  • Make it push more information about the discussion that was updated, so that we can check whether we already have the most up-to-date information, and don't have to extend addDiscussion.
  • Don't say there are updated discussions if they are in a hidden tag
  • Push to a user whenever they read notifications, so that the number of unread notifications stays in sync between browser windows.
  • Push for discussion events (e.g. discussion renaming)
  • Push for post likes
  • Show a little bubble every time a notification is received (again, this is something that would probably belong in core)
  • Push user online status (via presence channels? idk)

What needs to be done:

  • Working out a plan of attack for that first bullet point is the most important thing.
  • Reimplement the current basic features in a cleaner way.
  • Create issues for the additional features.

Copied from original issue: flarum/pusher#1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions