remote-edit-ni
remote-edit-ni copied to clipboard
Improve reliability
In the recent past I have had a situation where the connection had failed due to network problems and saving failed silently (the connection was not rebuilt). This may be related to the underlying library or in the handling of exceptions by remote-edit.
Comment by @urban-1 in #14:
Regarding reliability I think we are good atm, however, I do remember cases where the connection was timing out and was not reconnecting (some versions ago). Not sure what caused it but remember sveale#226 which made buffer.save() async.
Now, 7a9f3ae#diff-ad08e8b5a4ec10998ff9b3bdc131f954L97 (line 97) tried to fix the async save but the emitter is still wrong. We made in the past upload() and initiateUpload() returning Promises. This allows for more robust implementation. Pushed another commit moving the emitter to the correct place here (line 127).
I think we need better (more detailed) error handling at https://github.com/newinnovations/remote-edit-ni/blob/master/lib/model/remote-edit-editor.js#L214. I see two problems as is now:
- Errors that come from writeFile() are not handled at all! Only errors from wrong password are
- I don't see us rejecting the Promise on error (since we dont handle them..)