Like issue mentioned in https://github.com/marcoarment/FCModel/issues/106, when we cleaned several tables' records locally (execute sql statement directly) & try to pull data from server, these cached records will lead some problems.
e.g., we use updatedAt to judge whether need to update local record w/ the one fetched from server. As cached record will always have a same updatedAt to the one fetched from server, as a result, when cleaned local data & pull again from server, no new record will be created locally after pulling, cause we think these record exists & values are latest. Especially for the case that fetch big records one by one.
Though there's a way to load all cached instances w/ +allLoadedInstances and remove one by one w/ -removeFromCache, I think it's good to provide a convenient method to remove the whole cached array in g_instances at once. :)
Hi @marcoarment ,
Like issue mentioned in https://github.com/marcoarment/FCModel/issues/106, when we cleaned several tables' records locally (execute sql statement directly) & try to pull data from server, these cached records will lead some problems.
e.g., we use
updatedAt
to judge whether need to update local record w/ the one fetched from server. As cached record will always have a sameupdatedAt
to the one fetched from server, as a result, when cleaned local data & pull again from server, no new record will be created locally after pulling, cause we think these record exists & values are latest. Especially for the case that fetch big records one by one.Though there's a way to load all cached instances w/
+allLoadedInstances
and remove one by one w/-removeFromCache
, I think it's good to provide a convenient method to remove the whole cached array ing_instances
at once. :)