rrbrambley / MessageBeast-Android

A library for building Message-based apps on App.net
MIT License
5 stars 0 forks source link

DisplayLocation instance is not persisted for messages that failed to reverse geocode on retrieval #30

Closed rrbrambley closed 10 years ago

rrbrambley commented 10 years ago

When the DisplayLocations are assigned upon loading messages from the database, a value of false is passed for the persist flag in lookupLocation(). This is because we assume that the display location was already assigned once and persisted when the retrieveMessages() method was called, so we optimize by avoiding a unnecessary insert. This could technically fail for all kinds of display locations, but geolocations are more susceptible to this failure because reverse geocoding can fail easily (e.g. when performing a ton of them upon full sync).

One solution might be to just assign display locations at the DB level - i.e. to rely on the display location instances table to populate the display locations when they are being pulled from sqlite. Then, only if a message does not have a display location we will attempt location lookup and always persist one if we find it.

rrbrambley commented 10 years ago

fixed in ae8d7aabfcb2f805b51db8007987c68fc1e74374