-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mercurywm: fix consistency issue with fast key strokes #60
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When the user types fast in the client, we update the cursor locally, but wait for the server to update the history. The message sent to the backend contains the full message which leads to consistency issues because the client doesn't update fast enough. This commit introduces a single source of truth (the server), and the client simply sends change events instead of updating the full string. This means by the time the server processes all of the changes, and react updates the client, we get the correct, consistent state.
MichaelKim
approved these changes
Apr 19, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just add the new action types to types.js
so flow doesn't get mad:
| {|
+type: 'INSERT_IN_COMMAND',
+text: string,
+historyIndex: number,
+insertIndex: number
|}
| {|
+type: 'DELETE_FROM_COMMAND',
+historyIndex: number,
+deleteIndex: number,
+deleteCount: number
|}
MichaelKim
added a commit
that referenced
this pull request
Apr 19, 2019
This reverts commit c0b43e0.
MichaelKim
pushed a commit
that referenced
this pull request
May 14, 2019
* Don't use spread operator (#32) * Allow setting the font env variable to change the font (#35) * Fixed calls to getPath not passing the right arguments, which breaks RM (#34) * Fixed illegal border moves (#33) * Fix flow (#36) * Add flow types for global constants * Add flow strict * React update (#37) * Update react and react-dom to v16 * Move scroll logic to separate component * Fix paste not working (#38) * Fix missing window select on extensions (#40) * Fix clicking extensions not selecting window * Remove console log * Save backup in chrome storage (#41) * Save backup in chrome storage * Update descriptions for backup * mercury: add windowPadding environment variable (#43) This allows padding between windows to be adjusted, for if user wants to customize it that way. * Fix window select on render (#42) * mercury: fix window shift and workspace deletion (#46) * mercury: remove tab index (#45) They're all set to 1 so it doesn't make sense why we have it. Also, it doesn't actually focus the editor when you tab into it, and it shows an ugly blue focused line when you click on it. * mercurywm: fix no input and still remove outline (#47) * mercurywm: improved render (#48) - added support for CSS - command is more versatile, taking in a list of files - fixed absolute path calculation * Update packages (#51) * mercurywm: fix mkdir on root dir (#52) * mercurywm: add alias command (#55) * mercurywm: add alias command * mercurywm: add error messages to alias and env * mercurywm: window info padding and size in list (#56) Change padding in the window info bottom bar so it doesn't overflow out of the container, and add window sizes in `window list` * add home/end key cursor movement (#59) * mercurywm: fix consistency issue with fast key strokes (#60) * mercurywm: fix consistency issue with fast key strokes When the user types fast in the client, we update the cursor locally, but wait for the server to update the history. The message sent to the backend contains the full message which leads to consistency issues because the client doesn't update fast enough. This commit introduces a single source of truth (the server), and the client simply sends change events instead of updating the full string. This means by the time the server processes all of the changes, and react updates the client, we get the correct, consistent state. * mercurywm: add types for flow * Fix double tab autocomplete (#61) * mercurywm: fix merge on two windows (#63) * Fix alias flow (#64) * Fix Flow with aliases * Undo to single quotes * mercurywm: overwrite default console with our own (#62) Part of #10 * mercury: add test config for circleci (#66) * Fix CircleCI Config Issues (#67) * mercury: fix indentation * mercurywm: remove node version to use latest * CircleCI Publish to Web Store (#69) * CircleCI publish to Web Store * Add sudo to apt-get * Add script for build-number and uploading artifacts to CI (#70) * ci: add script to add build number * ci: upload build artifacts to CI * Version 2.0.1 (#71)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the user types fast in the client, we update the cursor
locally, but wait for the server to update the history.
The message sent to the backend contains the full message
which leads to consistency issues because the client doesn't
update fast enough. This commit introduces a single source
of truth (the server), and the client simply sends change
events instead of updating the full string. This means
by the time the server processes all of the changes, and
react updates the client, we get the correct, consistent state.
I think this fixes #14 as well, I can't repro it anymore.