3meters / patchr-ios

Next incarnation of Patchr for iOS
1 stars 0 forks source link

Orphaned entries in typing #29

Closed Jaymassena closed 7 years ago

Jaymassena commented 7 years ago

typing/gr-bu35bifpk/ch-kipip1l2y/kBjUvb6IDsQCIUFYDCdudfjDiTv1="larissa" The last key is the userId.

Jaymassena commented 7 years ago

Fixed for 212. I think this was because we never removed the typing indicator after starting to add a photo. One way to get an orphan is to crash before cleanup. If that happens, it won't get cleaned up until the user returns to the same channel. In most restarts, the user is automatically returned to the last channel they were using so clean-up would happen right away.

If firebase senses a disconnect (close app, network issues) then the typing entry is automatically removed.

A more robust solution might be to include a timestamp so stale items could be ignored until cleaned up. Clean up could be a garbage collecting process that makes periodic passes looking for orphans.