Wow ok, now I am truly confused. There is something strange (hah) afoot here.
This issue came up again in another context, and so I've had to debug it.
My steps were:
- Create a TestView / Mediator / Context with NO links to any project code (except for my base context which extends MVCSContext to use signals)
- Create a TestCommand which is a one-shot, and a TestRetainCommand which uses a coroutine to Retain, wait one second, then Release
- Copy the StrangeIoC framework out of my current project and into a blank project
- Copy the Test View/Moderator/Context and two test commands into the new project alongside strange
Now things get weird. In my existing project, this new clean uncluttered Test View/Context/Mediator exhibits the exact same behavior I described above:
If I fire the start signal with the one-shot test command, and the TestRetainCommand, both command fire twice. This stays consistent depending on how many commands I chain, for example:
commandBinder.Bind<TestCommandSignal>().InSequence()
.To<TestCommand>()
.To<TestCommand>()
.To<TestCommand>()
.To<TestCommand>()
.To<TestRetainCommand>();
This will execute each command 5 times.
In my
NEW, CLEAN project, the
EXACT same code behaves as expected, each command running only once. What?! As I mentioned, this new Test context etc. is not connected at all to any other code in my project. The only common link is StrangeIoC, as well as my custom BaseContext.
So, I went one step further and included ALL of my Strange-related code into the new clean project. I have all of my strange contexts, commands, signals, etc all with one common root folder.
So I brought in the whole entire system, and merely removed editor scripts (because they depend on other extensions, etc.) and some extensions (such as string extensions to remove path illegal characters when saving to disk, etc. nothing major)
So... the new project with the entirety of my strange-related code base
performs as expected, with no repetitions of commands.
I have no idea what is going on here, and the most sensible but terribly arduous path I can see right now is to slowly drag all of my assets and code from my old project into a new project until I discover what is causing this (or perhaps the issue will just magically disappear?).
Anyway, not sure anyone would have any new input based on that, but just wanted to give an update so that I can share the pain :p