Skip to content
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
merged 2 commits into from
Apr 19, 2019

Conversation

fg123
Copy link
Member

@fg123 fg123 commented Apr 19, 2019

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.

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.
Copy link
Member

@MichaelKim MichaelKim left a 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
    |}

@fg123 fg123 merged commit c0b43e0 into master Apr 19, 2019
@fg123 fg123 deleted the fg123-fix-fast-key-press branch April 19, 2019 17:27
MichaelKim added a commit that referenced this pull request Apr 19, 2019
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slight flicker on first command after clear()
2 participants