Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Will calculate dialog.unread on server side
This is a far better solution than what was introduced in
be44581. The problem with that
solution was even worse than what I expected: Seems like fetching
participants and messages for a bunch of dialogs results in either the
server or browser to drop some of the requests. I could be fooling
myself, but that's what it looks like from dev console.
So now instead, the code does one /api/user request which retrieves
the connections, notififications and dilalogs /with/ the unread count.
Later the javascript lazy loads the messages from the backend when a
dialog goes from "inactive" to "active" state and also handles
websocket reconnects.- Loading branch information
Showing
with
139 additions
and 111 deletions.
- +1 −1 assets/js/core/connection.js
- +9 −12 assets/js/core/dialog.js
- +46 −54 assets/js/core/user.js
- +3 −12 assets/js/main.js
- +5 −10 assets/vue/convos-dialog-container.vue
- +5 −2 assets/vue/convos-input.vue
- +1 −1 assets/vue/convos-login.vue
- +1 −1 assets/vue/convos-register.vue
- +8 −7 lib/Convos.pm
- +18 −7 lib/Convos/Controller/Dialog.pm
- +7 −0 lib/Convos/Controller/User.pm
- +21 −0 lib/Convos/Core/Dialog.pm
- +3 −2 public/convos-api.json
- +11 −2 t/web-dialog.t
Oops, something went wrong.