rrbrambley / MessageBeast-ObjC

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

Display location instance is not persisted for messages that failed to reverse geocode on fetch #24

Closed rrbrambley closed 10 years ago

rrbrambley commented 10 years ago

When the AATTDisplayLocations 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 44e0731b3068322446eb7a3f7be03c910fdcca28