-
Notifications
You must be signed in to change notification settings - Fork 282
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
basic notify_push usage with session handling #3876
Conversation
717e1da
to
f4dd246
Compare
tests and analysis currently still fail with errors, which seem totally unrelated to my changes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the pull request. This is a great start and I'm very sorry that it took so long to give some feedback. I had a first look at the code and the general approach. I've added some first remarks in the code.
I'll take some time the next days to setup notify_push locally so I can also give this a first test run.
Regarding the test failures, maybe you can rebase your changes. We had some CI failures lately but latest master should pass fine now.
Maybe to also kick of some discussion for the next steps, I'm not sure if you have thought about the live update process already, but there is probably a need for an improved approach from the refreshBoard that is currently happening. We already track and expose last modified dates for different elements so that might be an option so that the notify_push queue could advertise the last change date and the vuex store could refresh the content of just the affected items then. |
46c168a
to
f1b655f
Compare
@juliushaertl |
Thanks for the update, looking forward to that :) |
0bccc0e
to
ec099eb
Compare
@juliushaertl any plan for the review/merge of this highly awaited MR? |
I've added now some integration tests and would say that it is now ready to be reviewed from my side 🙂 |
Thanks, I'll have another look next week. |
@juliushaertl kindly reminder 😸 ❤️ |
Sorry for the delay, has been busy times 🙈 I'll schedule it next week again |
public function notifyAllSessions(IQueue $queue, int $boardId, $event, $excludeUserId, $body) { | ||
$activeSessions = $this->sessionMapper->findAllActive($boardId); | ||
|
||
foreach ($activeSessions as $session) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be nice is if we can somehow pass the current session id over on each request from the frontend so that we do not push notifications for the sessions own changes.
Maybe we could wrap axios in some way so that the session (if present) is added as a header to all requests through https://axios-http.com/docs/config_defaults
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this now as proposed: ae6774f
It feels a bit hacky, but couldn't think about a more beautiful way. maybe someone has suggestions? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the create session and close session events the initiating methods in the Session Service already have the token for the session that caused the event, but I guess for other changes taking the token from a HTTP header is the best approach. Nitpick: I would probably put the burden of finding out the token on the event emitting side, rather than always assuming that the current request is the source of truth. (Think e.g. when a change on board A triggers an automated change on board B in the distant future, then we wouldn't want to set the token from board A.)
Signed-off-by: chandi Langecker <git@chandi.it>
there is now no regular refreshing anymore, only after update events Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: chandi Langecker <git@chandi.it>
Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: chandi Langecker <git@chandi.it>
Co-authored-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: chandi Langecker <git@chandi.it>
which resolves the dependency issue: nextcloud-libraries/notify_push-client#5 (during the rebase the commit with an workaround got reverted nextcloud@5aa36aa) Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: chandi Langecker <git@chandi.it>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Pushed a commit to make the static analysis happy. Good to go from my side once CI is green 👍 |
I've just created an issue for further discussions about the session closing/creation topic #4354 @juliushaertl nice, big thanks for the commit, reviewing and everything else :) |
Thanks a lot for your awesome contribution. So great to see the first part being merged. Keep up the great work. ❤️ |
Summary
keeps track of current active sessions on a board and shows them in the UI, including real time updates via notify_push.
it is not very useful in itself, but acts as a base and is probably most of the work towards getting live updates for changes #256 finally, because the server needs to know to whom it sends these updates.
If this step goes through, I'm also happy to work on the actual live updates :)
Part of the code is thankfully taken from @juliushaertl sessions in text
Requirement
it needs notify_push installed and running.
Checklist