I send H:Event `A` but all instruments instead receive H:Event `B`

Version: 1.36.2 (recent regression)
Frequency: Always
Severity: High
Context: All aircraft using H:Events, in flight.
Bug description:

UPDATE
H:Events are confused when SimVar.GetRegisteredId is used across flight restart. See the second post in this thread for repro steps and investigation.

Hello. Multiple times now I have gone to debug a problem with my aircraft, and in the process of testing each part, I discover that one of my unique H:Events does not have the correct effect. Using an instrument which prints ā€˜interactionā€™ events to console.log, I find that while I send one event by name, a differently named event is immediately received, it is an entirely different unrelated event. I have only ever seen a single impacted H:Event at a time. The incorrect H:Event name is a valid string, in this most recent case it was an H:Event for something used in RPN when clicking a knob.

Iā€™m sending events with an unmodified SimVar.SetSimVarValue and receiving events to BaseInstrument!onInteractionEvent. The erroneous event is received on all instruments, not just the instrument from which the event was sent. I am sending these using the Coherent console, which rules out any internal string confusion within my compiled js assets.

Repro steps:

UPDATE See my second post in this thread for repro steps

Unfortunately for this bug I donā€™t have the specific repro case, but I wanted to report this anyway because I am doubtful that Iā€™m the only person to have seen this behavior. If there is some internal event confusion, then the actual root cause could explain many different behaviors that are inconsistently displayed across users. Restarting the sim causes the event to start working again, and for the issue to evaporate, evading further analysis.

I canā€™t think of what components in my aircraft could impact this, but I do use execute_calculator_code to dispatch H:Events from WASM since I donā€™t know of another approach. Notably though, the specific H:Events that I have observed with the faulting behavior arenā€™t touched via WASM.

Additionally, I didnā€™t have an empty Community folder, I had the GTN750 addon loaded. That is a pure JS avionics suite. I expect that means the same APIs I am working with above, so I donā€™t see how it could be a conflict of any kind. As I said when I reload the sim the bug is already gone.

Pierre discovered important information about the issue: H events become crazy after a flight restart

  1. This is new in SU14 and a very recent regression
  2. There is a 100% repro case
  3. The issue does seem to be the index relationship that powers setValueReg_Number vs setValue_Number is not fully cleared during flight restart.

Repro steps are:

  1. Load an aircraft (I used the JN4 for this test)
  2. Using the coherent console, open VCockpit01 (I think) context
  3. Register to see H:Events:
Coherent.on('OnInteractionEvent', (_, [name]) => {
  console.log("test event received: " + name);
});
  1. Send an event: SimVar.SetSimVarValue("H:TEST_EVENT_1","number",0);
  2. Observe test event received: TEST_EVENT_1
  3. Now go to the menu and Restart the flight. Wait for the flight to load and press Fly Now.
  4. (same as step 3) Register to see H:Events.
  5. (same as step 4) Send an event: SimVar.SetSimVarValue("H:TEST_EVENT_1","number",0);
  6. Observe that no event is received.

At this point you can observe that H:TEST_EVENT_2 (a not-previously-used event) is working fine.

You can also observe that Pierreā€™s fix works:

  1. Send these commands:
SimVar.g_bUseWatcher = false;
SimVar.SetSimVarValue("H:TEST_EVENT_1","number",0);
SimVar.g_bUseWatcher = true;
  1. Observe test event received: TEST_EVENT_1
2 Likes

Hello @davux3 @ScorpionFilm422 ,

Thank you for reporting this issue.
We were able to replicate the behavior you described and have created a ticket in our backlog.

Thank you for providing the reproduction steps. :slight_smile:

Regards,
Boris

3 Likes

Thank you Boris for your feedback.
Not sure to understand your answer.
You say that you were able to reproduce the issue but you ask for the reproduction steps.
The reproduction requires some specifc context (aircraft, mods) not easy for you to reproduce.
Anyway, when the issue is fixed, I could be able to test it in this specific context.

I was just saying thank you for the steps to reproduce this bug that @davux3 gave us above.
Also thanks to you for the workaround in your topic.

Regards,
Boris

1 Like

ah ok, sorry for the misunderstanding

Boris,
Something has changed around that in 1.37.4.0?
I have a weird behavior:
SimVar.GetSimVarValue(ā€œAUTOPILOT AVAILABLEā€, ā€œBooleanā€)
returns a number instead of a boolean
Tried with ā€œBoolā€, same result.

That breaks many things.

See this example in the attachments.


2024-02-23 12_36_01-NVIDIA GeForce Overlay DT

Hello @ScorpionFilm422

Please follow the guidelines and post a dedicated bug report in the SU15 flighting section so we can properly track the issue.

Regards,
Sylvain

Hello Sylvain (@FlyingRaccoon),

Until now, I saw your reply. I am going to post the dedicated bug report for the issue described by Pierre (@ScorpionFilm422), because I had the same issue. I deleted my previous post to follow the instruction given in your answer.

Thank you very much for your quick answer.

Regards,
Carlos Gonzalez
NextGen Simulations

It looks like (Iā€™m not 100% sure) a fix didnā€™t make it for SU15?

The results of this issue are so varied that end users are unlikely to successfully report the issue. Instead aircrafts have undefined behavior (as random H:Events are dispatched) after flight restart.

There is a solid workaround available, but all existing content without an update is still susceptible.

Hi Dave (@davux3),

I tested using the current build of my EMB-110, which does not have the code workaround proposed here in this thread, and the issue unfortunately is still there, also confirmed by a user of mine on the NextGenā€™s Discord. :frowning_face:

And since SU15 is the last sim update for the 2020 sequel of the sim before the forthcoming 2024 one, I would like to see this issue fixed, even as part of an ā€œunscheduledā€ minor hotfix. This is of course something to be concerned about, because of unexpected behaviors that can happen, like you stated.

For now, I am sending the respective emergency patch to my product, addressing that bug. Plus, I saved that code for use on the other aircraft I have in development right now, because I guess I will need it just in case.

Regards,

Carlos Daniel Gonzalez Gomez
CEO & Lead Developer
NextGen Simulations

1 Like