rrbrambley / MessageBeast-Android

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

Prevent pending file from being deleted before all messages have had their annotations updated #24

Open rrbrambley opened 10 years ago

rrbrambley commented 10 years ago

Currently, the MessageManager and FileManager both listen for the FileUploadService.INTENT_ACTION_FILE_UPLOAD_COMPLETE broadcast to perform their own tasks.

The MessageManager modifies the annotations of all messages dependent on the file and deletes pending file attachments from the db.

The FileManager removes the pending file from the db.

It's possible that the pending file could be removed from the db right before a crash/termination, leaving the Messages in an unrecoverable state (i.e. with pending message attachments pointing to a pending file id that doesn't exist).

Fix this.

rrbrambley commented 10 years ago

I think d26b0e2a2af20919afe99a9a8bf5c3b50748acf0 is related.