Fix #6444: Crash when using Input in a DEFAULT_MODE screen#6492
Open
Birnendampf wants to merge 3 commits intoTextualize:mainfrom
Open
Fix #6444: Crash when using Input in a DEFAULT_MODE screen#6492Birnendampf wants to merge 3 commits intoTextualize:mainfrom
Birnendampf wants to merge 3 commits intoTextualize:mainfrom
Conversation
Author
|
If there is anything I can do to make this more mergeable please lmk! I can move the concerns raised here to a discussion instead if that is preferred. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue described in #6444
This was specifically caused by textual's use of eager task factories, causing the widgets in the screen to start processing messages before the screen is ever added to the screen stack. This may be a larger underlying oversight which is not fixed here and might require further investigation.
There are also some other things to note:
App.run_test()does not useasyncio.eager_task_factory. This does not seem correct, as it causes a discrepancy between tests and reality. E.g. this bug does not occur withrun_test()by default.This is beyond the scope of this PR and should probably be a separate issue, unless this is intended.
except NoScreen, ScreenStackErrorhere:textual/src/textual/app.py
Lines 4555 to 4560 in 0f0849f
TextAreadoes instead.Furthermore, the
_defaultscreen is composed after being added to the stack.If that is the correct behavior, it would likely also fix this issue, making this PR obsolete.
Link to issue or discussion
fixes #6444