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

Lost characters when typing fast and DOT parsing errors occur #236

Closed
Honghe opened this issue Nov 4, 2023 · 2 comments
Closed

Lost characters when typing fast and DOT parsing errors occur #236

Honghe opened this issue Nov 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Honghe
Copy link

Honghe commented Nov 4, 2023

Below gif is the replay (2x times slower typing speed), i.e. the l letter is lost.
magjac_bug3

@magjac magjac added the bug Something isn't working label Nov 5, 2023
@magjac
Copy link
Owner

magjac commented Nov 5, 2023

Thanks for the report. I've seen this myself too.

You might be able to avoid this problem most of the time, by setting the hold-off time to something like one second in the settings:

image

I've struggled with similar bugs in the past:

This seems to be yet another flavor 😩 .

@magjac
Copy link
Owner

magjac commented Nov 5, 2023

Some debugging shows that this is the same problem as #22.

Five years ago, I seem to have been aware of that this problem was not entirely fixed. See #22 (comment).

@magjac magjac closed this as completed in 0062951 Nov 15, 2023
@magjac magjac changed the title Bug: The input is error when typing quickly Lost characters when typing fast and DOT parsing errors occur Nov 15, 2023
magjac added a commit that referenced this issue Dec 17, 2023
…iting in the graph

This is a rework of the DOT source handling to avoid a race caused by
constantly feeding back the DOT source to the text editor. This race
seems to have been latent, but an upcoming commit that changes to the
new root API in React 18, which seems much faster, exposes it.

Now, the DOT source is only fed back to the text editor when
specifically requested. This is currenty done at startup and when
editing the graph in the graph view. This is not expected to interfere
with a user editing the text, since it should not be possible to do
that at the same time.

This also removes the now unnecessary workaround for
#236
implemented in 0062951.
magjac added a commit that referenced this issue Dec 17, 2023
…ting in the graph

This is a rework of the DOT source handling to avoid a race caused by
constantly feeding back the DOT source to the text editor. This race
seems to have been latent, but an upcoming commit that changes to the
new root API in React 18, which seems much faster, exposes it.

Now, the DOT source is only fed back to the text editor when
specifically requested. This is currenty done at startup and when
editing the graph in the graph view. This is not expected to interfere
with a user editing the text, since it should not be possible to do
that at the same time.

This also removes the now unnecessary workaround for
#236
implemented in 0062951.
magjac added a commit that referenced this issue Dec 18, 2023
This is a rework of the DOT source handling to avoid a race caused by
constantly feeding back the DOT source to the text editor. Now,
instead the DOT source is only fed back to the text editor when
specifically requested. This is currenty done at startup, when using
the open from browser dialog and when editing the graph in the graph
view. This is not expected to interfere with a user editing the text
in the text editor, since it should not be possible to do that at the
same time.

This also removes workaround for
#236
implemented in 0062951 which is no
longer needed.

This was a latent race bug which was exposed by an upcoming commit
that changes to the new, seemingly faster, root API in React 18.

Without this, the upcoming commit would cause errors like this in the
Cypress end-to-end tests:

  1) Text editor
       A graph is rendered when DOT source code is typed slowly in the text editor:

      Timed out retrying after 10000ms
      + expected - actual

      -'Alce'
      +'Alice'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants