hirosystems/todos

Todo items disappear when first logging in

Closed this issue · 2 comments

On first log in, while storage is all synchronizing. A todo list item will be created, but then about 5-10 seconds later, then todo list will refresh as an empty list.

I believe what's happening is that the backing storage is still initializing and the first getFile hasn't returned yet, and then once it does, it returns an empty list. Namely, the fetchData callback here returns after the todo list item already appeared to the user:

https://github.com/blockstack/blockstack-todos/blob/master/src/components/Dashboard.vue#L76

This will return the initial empty list. After this initial hiccup, the todo list saves to storage normally.

mrjmd commented

I can confirm this bug. It seems like at the very least there should be some mechanism for detecting if / when storage is ready and giving a user feedback that they can't save todos until then?

My first thought was that there was simply no persistence in the todo app.

I submitted a pull request that I believe addresses this issue:

#23

Added loading: true to default data. When fetchData returns todos, it also sets loading to false. A spinning loader icon will be displayed to user until fetchData returns todos.