element-hq / element-hq/element-web
Input textbox accepts enough input to freeze the program
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
### Description
I mistakenly pasted about 1 mb of text from the clipboard into a conversation and Element. Initially I tried to delete it, but deletion caused the program to freeze. Although the UI was frozen (I let it sit for about 2 minutes), Element had saved it as a draft and performed a normal quit. The text was still present in the input box the next load and therefore the room hasn't been usable because the bug becomes a loop.
### Steps to reproduce
- Gather large amount of text (1.0 mb / 14223 lines / 1,063,246 characters in my case)
- Paste it into text box
- Select all, delete text (UI should freeze)
- Quit application
- Restart application
- See large amount of text in textbox saved as draft
- Select all, delete text (UI should freeze)
- Quit application
- Restart application
- See large amount of text in textbox saved as draft
- Select all, delete text (UI should freeze)
- Quit application
- Restart application
- See large amount of text in textbox saved as draft
- etc.
### Possible solution(s)
- Truncate text at an arbitrary amount that is high enough to not be noticed, but low enough to keep performance in check.
- Evaluate for any unnecessary text processing during delete text action (delete keypress, delete event)
Contributor guide
Research direction
Start by reproducing the issue with roughly 1 MB of pasted text, then inspect the input box's delete handling and draft persistence path. Compare the work performed during paste, select-all deletion, quit, and restart. Done means large drafts no longer freeze the UI during deletion and do not recreate the unusable loop after restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, performance, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100