rgh-improve-new-issue-form - Restore version auto-input#9293
Conversation
There was a problem hiding this comment.
I don't think there is a better solution
There was a problem hiding this comment.
Session storage key for auto-restore: refined-github-refined-github.1_bug_report.yml-Extension version-client:MDEwOlJlcG9zaXRvcnk1MTc2OTY4OQ==:issueForm(filename:"1_bug_report.yml"):elements:3
The client value can be taken from the command palette DOM (unreliable) or from the React payload (slow and unreliable). Additionally, we can't be sure if we set the value fast enough for GitHub to pick it up
| // Wait for GitHub listener to be registered | ||
| await delay(2000); |
There was a problem hiding this comment.
Minimum value for me is 1000
There was a problem hiding this comment.
It's also inconsistent. I definitely ran into the issue during multiple tests with a 500ms delay, but I can't reproduce it now. Let's settle on 1000ms
| // Wait for GitHub listener to be registered | ||
| await delay(2000); |
ffda160 to
f1eb6f6
Compare
| ); | ||
|
|
||
| // Wait for GitHub's listener to be attached #9293 | ||
| await delay(2000); |
There was a problem hiding this comment.
Two seconds is a long time, won't it affect any other fields if the user is already typing? If not, we're good to go.
There was a problem hiding this comment.
won't it affect any other fields if the user is already typing
It doesn't
fixes occasional element not found errors
Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>


Test URLs
https://github.com/refined-github/refined-github/issues/new?template=1_bug_report.yml
Screenshot