ryjm / habitrpg.el

org-mode integration for habitrpg
55 stars 4 forks source link

Better offline behaviour (feature request) #3

Open natfarleydev opened 10 years ago

natfarleydev commented 10 years ago

When emacs can't reach the internet, currently habitrpg.el gracefully throws errors. Ideally, habitrpg.el would store the changes and then change habitrpg.com when reconnected to the internet.

E.g. the following could happen when not connected to the internet and adding a TODO item:

  1. habitrpg.el finds it can't send data to habitrpg
  2. habitrpg.el stores (somehow) the TODO time
  3. habitrpg.el checks if there's internet (maybe with an idle timer?)
  4. if there is internet, check the list and upload the changes.
ryjm commented 10 years ago

Been meaning to do something like this, I'll see what I can do.

ryjm commented 10 years ago

I added some offline behavior in ba9679e70ed2b4deb5c45f4571f038f70612afa8

natfarleydev commented 10 years ago

Nice work! I tried it out and found that when offline in the habitrpg:status buffer:

Method I used:

The offline behaviour did not work in a separate org mode file (although this looks to be the intended behaviour at the moment, correct me if I'm wrong!). I just wish I knew more lisp so I could help out!

ryjm commented 10 years ago

nasfarley88 notifications@github.com writes:

Nice work! I tried it out and found that when offline in the habitrpg:status buffer:

  • Works great for habits, but shows health loss as 'nil' (presumably because it tries to find out and fails)
  • The todo item I crossed off didn't sync when online again.

Method I used:

  • Go offline
  • Visit habitrpg:status buffer
  • Cross off todo
  • Downvote habit
  • go online
  • press 'g' to refresh

The backlog of tasks that needed to be upvoted/added was only being processed after an org-mode state change (i.e from TODO to NEXT). Forgot about the status buffer! The commit I just made should fix that - now the backlog will be processed on a status buffer refresh.

The offline behaviour did not work in a separate org mode file (although this looks to be the intended behaviour at the moment, correct me if I'm wrong!). I just wish I knew more lisp so I could help out!

Strange. I'll keep testing it.


Reply to this email directly or view it on GitHub: https://github.com/ryjm/habitrpg.el/issues/3#issuecomment-41387785