Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor how backend handle notifications #1433

Open
iamdey opened this issue Jun 13, 2019 · 2 comments
Open

Refactor how backend handle notifications #1433

iamdey opened this issue Jun 13, 2019 · 2 comments

Comments

@iamdey
Copy link
Member

iamdey commented Jun 13, 2019

  • batch operations should emit one notification only, at end of batch.
  • notification model should handle multiple sub-notifications
  • add generic notification model for new messages, whatever the emiter is
  • allow to request notifications range by notification-id
  • add discussion_id into new message notifications
@iamdey iamdey changed the title #### Refactor how backend handle notifications Refactor how backend handle notifications Jun 13, 2019
@iamdey
Copy link
Member Author

iamdey commented Jun 13, 2019

after discussion, notif structure:

{
  emmiter: …,
  type: "new-messages",
  notif_id: …,
  body: {
    size: N,
    elements: {optional} [
      { message_id: <str>, discussion_id: <str> },
      …
    ],
  }
}

elements is undefined when the number of new messages is over 20.

the discussion_id is the last known id so it might not match the id stored in a tab (client side).

@iamdey
Copy link
Member Author

iamdey commented Jun 13, 2019

on the client, we need to parse the new scheme since all new notifs go like previous post

when receiving notifications:

  • filter notifs using ?last-notif-id (FIXME)
  • iterate on «batches» (type new-messages)
  • update timeline
  • invalidate opened discussions

-> this way we can't display how many new messages have been received

or eventually filter on discussion_ids found in batchs …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant