timwis / enviar

Chat interface for SMS / text messages
37 stars 6 forks source link

use drafts for outbound and replace them when sent #33

Closed timwis closed 8 years ago

timwis commented 8 years ago

Idea! Regarding the flash on the client from insert happening before delete. Instead of sending 2 transactions (insert, then delete), just make two inserts! One adds a new record, the other updates the draft, setting it to discarded or something.

EDIT: Looks like .bulk() lets you perform deletes

timwis commented 8 years ago

Per the bulk document api docs:

Bulk updates work independently of replication, the documents updated in a _bulk_docs request will not be replicated as a group, and will not even necessarily be replicated in the same order as they were in the request.

:-/ The only other idea, then, is to (1) update the draft with the new provider id, (2) have the view check whether there's a message with that provider id in the state before rendering drafts...

timwis commented 8 years ago

Superseded by #35