-
Notifications
You must be signed in to change notification settings - Fork 617
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
[cmd] Revert "Call wrapped command initSendable (#6471)" #7353
Conversation
…pilibsuite#6471)" This reverts commit 7bc0380. Calling initSendable on the wrapped command is fundamentally flawed as the wrapper is the command being sent.
This PR modifies commands. Please open a corresponding PR in Python Commands and include a link to this PR. |
Looks like the original PR wasn't done in Python, since I don't see anything sendable-related in wrappercommand.py. |
I mean, all this started from #6292. The wrapped command's sendable representation should be sent - the problem is the scheduling lambdas (which need to point to the wrapper command instead) |
There's not a good way of doing that currently. This doesn't work (easily) for finallyDo/handleInterrupt, unfortunately. This ultimately comes back to the whole problem of internal visibility of compositions- currently, by design, everything is opaque, which makes it near impossible to get that visibility back when you want it (e.g. for telemetry) |
Why would you not be able to use the original command in case of mutation? It would be a silent state change rather than a loud error. |
Perhaps I'm misinterpreting, but I think what @rzblue meant is that because you already can't use the original command, it's fine for us to mutate it since no previous behavior could have relied on having the original still around. I'm still a bit iffy about mutating the original command, though, since it could cause confusion if people are reusing commands that then get decorated, and I also don't see how we would be able to do it because of the need to override the methods. (In |
Would implementing |
It would make the implementation more similar to the others, but it would prevent a regular |
No, and it still wouldn't fix the core issue here- WrapperCommand is a composition, and augments the behavior of the wrapped command. WrapperCommand cannot safely "unwrap" itself without violating it's own invariants.
Peter brought up that we could use function pointers stored in the base class and mutate those- this is doable but a bit tricky to reason about and a large departure from the previous implementation. |
Closes #7352
This reverts commit 7bc0380.
Calling initSendable on the wrapped command is fundamentally flawed as the wrapper is the command being sent.