-
Notifications
You must be signed in to change notification settings - Fork 0
Fix issue #5
base: master
Are you sure you want to change the base?
Fix issue #5
Conversation
|
The only change to the main |
…. Refactor code to use webpack
… be fine. Refactor code to use webpack" This reverts commit 4c08fe8.
|
Resolves #1 |
|
Hey! Thanks for your work on this, seems like you are very familiar with both code bases now! I was wondering what happens if a save fail, that is, the web page collects the changes and makes a pull request but it never reaches the server. Is it now the caller responsibility to keep track of the changes? Also, haven't looked through the fork other changes, but this would be an API breaking change, not sure if you would ever be able to get the change merge upstream, unless you make it like an optional parameter or something. Would it be better to keep a buffer of unsync changes in our app? Or maybe we could add a new API to do this on the livewriting code? |
|
Thanks! Working on this has been fun. The way I have it right now, it would be the caller's responsibility to keep track of changed on save fail. Not 100% sure how to change this without doing something like pass the caller's function to I think I'd we wanted to keep this change, we could make it happen with an optional parameter. I'm not sure whether it's better to keep a buffer of unsync changes or add a new API; I don't think a save would ever be larger than 100mb. Unless it's really slow or something, I guess we don't need the flush the buffer change |
|
Definitely leaning toward not flushing the buffer knowing that no saves will exceed 100mb |
|
Although it wouldn't exceed, how does performance degradation look like? Uploading a 20 Mb could take a few seconds... |
|
@G018 Will we have to change our code if I change the API? Not 100% sure if it's worth the time |
This ended up being a pretty simple issue; only two lines of code needed to be changed.
Now instead of cumulatively returning all actions that have ever been done,
getActionData(in thelivewriting.jsmodule) only returns the actions made since the last save.So instead if the user typed
ab, saved, then typedbc, the new version sends an action containingabthenbcinstead ofabcd(the old version).As a side effect, the actions logged by
fs.outputJSON(path.join(this.other, file, timestamp + '.json'), data)only contain actions taken since the lastCmd+Ssave instead of all cumulative actions.