[web] Create thread when multimedia message is sent
Summary:
Use new error handling and create realized thread when multimedia message is sent.
Every time a user sends a message or retries and a thread is pending, we make sure to put a promise into a map. This promise will be awaited when a message is sent.
Test Plan:
Testing here was quite extensive, but I'll try to include couple of scenarios:
- Add an upload, wait for it to finish and send a message
- Add an upload and before it's finished send a message
- Add an upload, wait for it to finish and send a message on another device
- Add an upload and before it's finished send a message on another device
Modify thread creator to fail every other time and:
- Add an upload, wait for it to finish and send a message, then retry
- Add an upload and before it's finished send a messahe, then retry
- Send multimedia message and send a message from another device
Modify message responder to fail every other time and perform similar procedure.
etc.
Even more testing was performed with more complicated scenarios and I can provide more details, but for now I guess this list might be enough.
Reviewers: ashoat
Reviewed By: ashoat
Subscribers: KatPo, Adrian, atul
Differential Revision: https://phabricator.ashoat.com/D1100