SpringAll icon indicating copy to clipboard operation
SpringAll copied to clipboard

Polish devise_lastseenable

Open jhass opened this issue 11 years ago • 6 comments

devise_lastseenable is probably the most crufty dependency we have and it also seems unmaintained. It's a small nice project so polishing it would be a good task to embark ones own Ruby skills. List of things todo:

  • [ ] Write a sane .gemspec. The current one includes all sort of unnecessary stuff and also includes it many useless files into the gem.
  • [ ] Readd Gemfile.lock. The PR removing it was plainly wrong.
  • [ ] Add tests
  • [ ] Make timeout interval configurable. There are already patches to do that, look through the forks.
  • [ ] If submitted PRs keep unaccepted try to overtake maintainership.
  • [ ] If taking over maintainership fails try to obtain push rights to the gem on rubygems.org
  • [ ] If that also fails publish gem under new name and maybe fork to diaspora organization on Github.

jhass avatar Feb 23 '14 13:02 jhass

Hey, @jhass I would love to contribute to diaspora*, and I think I could take care of this issue :D

Seems that https://github.com/ctide/devise_lastseenable would not be updated anymore last opened PR from 2017 is still open. I found another similar gem called: https://github.com/iplan/iplan-devise-lastseenable but I don't know why it wasn't published to rubygems.

If this new gem can't replace the devise_lastseenable, I could assume a new version and maintain it from now.

What do you think @jhass ?

brunoocasali avatar Aug 28 '21 15:08 brunoocasali

Be my guest, I have no plans for it :)

jhass avatar Aug 28 '21 16:08 jhass

@jhass https://github.com/diaspora/diaspora/pull/8286 🎉 🌮

brunoocasali avatar Sep 01 '21 12:09 brunoocasali

What makes 'last_seenable' better than device's 'trackable' ?

https://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Trackable

ThorstenClaus avatar Sep 03 '21 06:09 ThorstenClaus

Well, they solve different problems see the wardens hook for trackable https://github.com/heartcombo/devise/blob/c82e4cf47b02002b2fd7ca31d441cf1043fc634c/lib/devise/hooks/trackable.rb#L7

Devise's trackable will only update the user model after each "sign_in"/login etc. But the last_seen gem will mark a timestamp every time a @current_user is called. A real world example could be:

trackable:

  • when you login in diaspora, mark the user. (so the date persisted will be now: Fri 3 sep 10:00 AM)
  • the time pass to 12:00 PM... I'm still logged in
  • But the date still Fri 3 sep 10:00 AM even after hours I've been using the app.

last_seen:

  • when you login in diaspora, mark the user. (so the date persisted will be now: Fri 3 sep 10:00 AM)
  • the time pass to 12:00 PM... I'm still logged in
  • The date now will be Fri 3 sep 12:00 PM

brunoocasali avatar Sep 03 '21 13:09 brunoocasali

The makes sense - thanks for clarification

tclaus avatar Sep 03 '21 18:09 tclaus