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

if riot is slow, pasting into the RTE can race with typing #4708

Closed
ara4n opened this issue Jul 31, 2017 · 3 comments
Closed

if riot is slow, pasting into the RTE can race with typing #4708

ara4n opened this issue Jul 31, 2017 · 3 comments
Labels
P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@ara4n
Copy link
Member

ara4n commented Jul 31, 2017

I think this is the root of most of my RTE problems - if riot is being laggy, then pressing cmd-V to paste a URL may race with the stuff I am trying to type after it, causing the typing to appear before the thing I paste, despite me having pasted first.

@lampholder lampholder added T-Defect S-Major Severely degrades major functionality or product features, with no satisfactory workaround P1 type:rte labels Jul 31, 2017
@lukebarnard1
Copy link
Contributor

I've seen a bug similar to this one where the selection state gets needlessly set to the beginning of the composer and I'm not convinced it's a race. (See #4675)

@lukebarnard1
Copy link
Contributor

lukebarnard1 commented Aug 7, 2017

Upon investigation, this looks like a race in draft-js between paste handling and character insertion. This is likely because sometimes draft does native character insertions, which are done on (potentially) a different event-loop to the pasting.

So when perf drops, the native character insertions get done first, followed by the pastes.

(N.B. useful snippet to introduce deliberate lag :3 setInterval(() => {i = 0; while ( i++ < 10000 ) console.debug(i);}, 2000); and as a test one can repeatedly alternate between pasting something like "paste" and inserting a "0". The bug is observed when you see "pastepaste")

Bug filled upstream: facebookarchive/draft-js#1325

@ara4n
Copy link
Member Author

ara4n commented Jul 16, 2018

fixed in matrix-org/matrix-react-sdk#1890, thank goodness

@ara4n ara4n closed this as completed Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

3 participants