Resolves #523#525
Conversation
|
mock-fs and proper-lockfile are incompatible, but mock-fs also breaks console.log, so I can't figure out why. One of the two needs to be abandoned, but both are important.... |
|
Without looking into it I assumed it was save file being accessed before the initial saved completed. I didn't think it would be the server choking up. I'll look at this in more detail tomorrow. It would make sense with the secondary thing I experienced where the machine would lock for like 2 minutes afterwards (in retrospect it was the requests that weren't working) and then everything would work again. |
Yep, that's express getting swamped, not an FS issue. I basically invented inverse slowloris. |
BryonLewis
left a comment
There was a problem hiding this comment.
Everything looks good and seems to resolve the issues. Just a few questions that can probably be dismissed.
This comment it probably an extreme corner and something that we don't need to worry about now. Unlikely case there is a memory overflow error or a task manager kill while the file is locked will prevent the lock file from being removed. Then when you restart the app and open it again it won't allow you to save the file but then the act of properly closing it will remove the existing lock file that it couldn't acquire a lock on. So just a note if there is an error where it crashes -> user restarts and can't save -> closes and then can save after is it crashing during saving or while a lock file is active.
I would think the only remedy would be to clear any existing lock files in the directory on initial launch if they exist. In combination with ensuring there is only a single electron instance open at once - https://github.com/electron/electron/blob/master/docs/api/app.md#apprequestsingleinstancelock
Are you sure, and have you tested? The lockfile library has a staleness check mechanism which defaults to 10 seconds. I'm using https://github.com/moxystudio/node-proper-lockfile, not electron's locking.
So 10 seconds after the crash, lockfile will become stale and save will work. |
|
Confirmed, it was an issue in my testing and how I instigated the error. |
resolves #523
Fixes for a great number of issues on my part.
endsignal from ConfidenceFilter. It will usually be emitted twice because of how we have to catch it, but we don't want 1 change to trigger 2 requests (as it currently does).It's worth mentioning that there's nothing currently preventing someone from having 2 instances of dive open on the same project where the annotations diverge because they aren't loaded from disk except once at launch. This is probably not important, but a lockfile could at least yell about it. With proper-lockfile, it'd be like 10 lines of code to add this check. IDK if it's worth it.