deck icon indicating copy to clipboard operation
deck copied to clipboard

basic notify_push usage with session handling

Open alangecker opened this issue 3 years ago • 4 comments

  • Touches: #256
  • Target version: master

Summary

keeps track of current active sessions on a board and shows them in the UI, including real time updates via notify_push.

screen

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.

TODO

  • [ ] get some confirmation that this way is somehow sane (also first time for me developing with nextcloud 🙂 )
  • [x] Fix 500 errors when notify_push isn't enabled.
  • [x] consider case of multiple open windows by the same user
  • [x] fix existing tests and linting
  • [ ] write some tests
  • [ ] add API documentation

Checklist

  • [x] Code is properly formatted
  • [x] Sign-off message is added to all commits
  • [ ] Tests (unit, integration, api and/or acceptance) are included
  • [ ] Documentation (manuals or wiki) has been updated or is not required

alangecker avatar Jun 20 '22 21:06 alangecker

tests and analysis currently still fail with errors, which seem totally unrelated to my changes. Is master broken or do I oversee somthing?

  • ERROR: UndefinedMethod - lib/Service/CirclesService.php:61:21 - Method OCA\Circles\CirclesManager::startSuperSession does not exist

    • Other PR's like also fail, so probably not my fault :)
  • .

    1) OCA\Deck\Db\AssignmentMapperTest::testFind
    OCA\Deck\NoPermissionException: Creating boards has been disabled for your account.
    
    /home/runner/work/deck/deck/apps/deck/lib/Service/BoardService.php:316
    /home/runner/work/deck/deck/apps/deck/tests/integration/database/AssignmentMapperTest.php:98
    /home/runner/work/deck/deck/apps/deck/tests/integration/database/AssignmentMapperTest.php:93
    
  • Error: Your lock file does not contain a compatible set of packages. Please run composer update. (didn't modify the compose files)

alangecker avatar Jun 24 '22 14:06 alangecker

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.

juliusknorr avatar Jul 26 '22 15:07 juliusknorr

@juliushaertl thanks for all the feedback 🙂 It is now rebased (hopefully fixing the CI issues) and I resolved some of the smaller points, will continue on it but maybe won't find much time in the next 2 weeks

alangecker avatar Aug 04 '22 22:08 alangecker

Thanks for the update, looking forward to that :)

juliusknorr avatar Aug 05 '22 07:08 juliusknorr

@juliushaertl any plan for the review/merge of this highly awaited MR?

matbgn avatar Oct 04 '22 11:10 matbgn

I've added now some integration tests and would say that it is now ready to be reviewed from my side 🙂

alangecker avatar Oct 06 '22 14:10 alangecker

Thanks, I'll have another look next week.

juliusknorr avatar Oct 06 '22 17:10 juliusknorr

@juliushaertl kindly reminder 😸 ❤️

matbgn avatar Oct 28 '22 06:10 matbgn

Sorry for the delay, has been busy times 🙈 I'll schedule it next week again

juliusknorr avatar Oct 28 '22 07:10 juliusknorr

What an impressive job @alangecker ! 😍

I would be glad to buy you a coffee (yes maybe a big one)... Do you have any sponsorship link? Or any PayPal account?

matbgn avatar Nov 04 '22 23:11 matbgn

@matbgn thanks a lot ❤️

you've (hopefully) got a mail 🙂

(I've used the only address I could easily find now: mat.gh (at) bqn.**)

alangecker avatar Nov 05 '22 00:11 alangecker

@matbgn thanks a lot ❤️

you've (hopefully) got a mail 🙂

(If used the only address I could easily find now: mat.gh (at) bqn.**)

You've done it right! The order is gone, as I said it's not a big amount but I hope you will enjoy your next coffee and again: THANK YOU!

matbgn avatar Nov 05 '22 00:11 matbgn

@matbgn thank you very much!

as I already said in the mail, I'm always really happy that people donate for free software, even without asking - like you ❤️

alangecker avatar Nov 08 '22 12:11 alangecker

but for this PR I do not intend to implement actual updates for the stacks/cards, thought to limit it to the active session avatar list as the base and work on the live updates separately :)

And what I can promise you is that when you will release the live updates part I will just double it! 😉

Happy coding!

matbgn avatar Nov 08 '22 21:11 matbgn

so, from my side I don't see anything to do anymore. Would be great if someone (@juliushaertl ?) could do another review (especially the recent changes with passing on the session token)

I have also started working on the actual live updates, which seems already fully working 🙂 https://github.com/alangecker/nextcloud-deck/compare/sessions...live-updates ~...PR incoming!~ -> PR here https://github.com/nextcloud/deck/pull/4273

alangecker avatar Nov 21 '22 19:11 alangecker

Sorry for the spam, but.. hell yeah! Really excited for this feature! 🎉

shoetten avatar Nov 21 '22 22:11 shoetten

I can only agree, really excited to see @juliushaertl's feedback

matbgn avatar Nov 22 '22 10:11 matbgn

From looking through the code, it looks really good, apart from the two nitpicks above! I'll also have to setup a test env to properly test it, though.

marcelklehr avatar Nov 23 '22 13:11 marcelklehr

I was able to successfully test this. Functionality works when notify_push is enabled and nothing breaks when it's not installed. Great stuff!

marcelklehr avatar Nov 24 '22 12:11 marcelklehr

Design-wise this is great first step towards achieving live updating boards! It looks great :) Really nice work! 🚀

nimishavijay avatar Dec 06 '22 19:12 nimishavijay

@nimishavijay

closing the session when the tab is not active might be a bit confusing, even if it's technically a cool feature. Google Docs also doesn't do this afaik. @juliushaertl / @jancborchardt Do we want this?

marcelklehr avatar Dec 06 '22 19:12 marcelklehr

Ah, missed that, sorry!

I would say closing the session immediately after the tab is unfocused would be confusing. If there was a timeout of say, 15 mins or something that would make more sense :)

nimishavijay avatar Dec 06 '22 19:12 nimishavijay

@juliushaertl @marcelklehr @nimishavijay Can we merge this sooner than later and work out any feature wishes you might have from a company perspective later? As far as i understand there are no technical blockers anymore and this PR is now almost half a year in review.

shoetten avatar Dec 22 '22 12:12 shoetten

@alangecker Could you maybe rebase to latest master to resolve the conflict? Would be fine to get this in then from my side.

I'd generally agree that the session close after the tab is in the background should rather be deferred for some time. This may also help to avoid additional load for creating and removing the extra sessions. That can also be a follow up of course ;)

juliusknorr avatar Dec 30 '22 13:12 juliusknorr

Pushed a commit to make the static analysis happy. Good to go from my side once CI is green 👍

juliusknorr avatar Jan 03 '23 14:01 juliusknorr

I've just created an issue for further discussions about the session closing/creation topic https://github.com/nextcloud/deck/issues/4354 maybe someone is motivated to put some thinking effort into it? 🙃

@juliushaertl nice, big thanks for the commit, reviewing and everything else :)

alangecker avatar Jan 03 '23 14:01 alangecker

Thanks a lot for your awesome contribution. So great to see the first part being merged. Keep up the great work. ❤️

juliusknorr avatar Jan 03 '23 14:01 juliusknorr