-
Notifications
You must be signed in to change notification settings - Fork 815
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
Command Palette duplicate ID on input kill (meta: OptionList
clearing bug)
#3714
Comments
This is probably unrelated to this error, but there are possibly some issues with |
While working on a pet project, I've managed to recreate the The upshot of it seems to be this: if you try and clear and reload options for an It's that test for size that seems to be kicking in in my current application; and I suspect this will explain why this is sometimes, but not always, seen with the command palette: there are times where it doesn't have size yet. |
OptionList
clearing bug)
As I've just run into this again a couple of times this morning in an app I'm testing, and as I think there's an easy win to be had if my assessment of the cause is correct, tagging @willmcgugan for triage. |
I'm almost positive that this has been resolved by the changes @rodrigogiraoserrao made to |
The original issue comment mentions a keybinding combo that leaves the command palette with no input but with some commands still showing. |
I suspect that will have been down to happenstance of how and when the exception occurred; moreover it wasn't an exact set of instructions for recreation of the problem, more just recording acts that happened around the time of the problem happening. That's not to say this issue should be closed, but I'm pretty confident it's now handled. |
I've given this a bit of a blast with the project that originally tickled the problem in November last year. After a pretty comprehensive attempt to recreate the problem I'm utterly failing (and this is a project that can have a lot of commands drop into the command palette -- I even quickly added command discovery support to overload it as much as possible without a hint of a problem). Given the deeper dive I did while on holiday in December and given the subsequent fix to that particular problem, I feel confident in closing this as resolved by the further work done on |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Removes workaround for Textualize/textual#3714 Fixes #2
At the moment, this issue is the opposite of an MRE, but is instead a reminder to make some time to try and produce one.
While riffing with a current pet project, I've found that it's possible to get the command palette to crash with
DuplicateID: Attempt made to add options with duplicate IDs
-- this cropped up a few times during development, but I thought we had it nailed.There is no exact recipe at the moment, but I have found this evening that when I can recreate it, the steps tend to be:
If the wind is in the right direction you'll be left with an empty
Input
but will still have commands in the results list:that is the main problem; for sure. For some reason the results haven't cleared down. After that, if you type something more, you'll get the
DuplicateID
.My initial suspicion would be that something is going wrong with
CommandPalette._input
.The first job here though is to try and narrow this down to a simple bit of code to recreate it (that's easy enough, it should just be a simple application with a command provider that has lots of hits), and a recipe to follow to get the error to happen on demand.
The text was updated successfully, but these errors were encountered: