Short Failsafe not working correctly – possibly due to codebase logic issue

Hi all,
I tested the short failsafe feature, but found that it is currently not working as expected. It appears that others have encountered the same issue - short failsafe triggered immediately without FS_SHORT_TIMEOUT:

https://discuss.ardupilot.org/t/fs-short-timeout-not-changing-rc-failsafe-timeout/119625
https://discuss.ardupilot.org/t/fs-short-timeout-does-not-work/54331
https://discuss.ardupilot.org/t/fs-short-actn-not-working/90635/2 (maybe)

After checking the code: Arduplane/system.cpp
Plane::check_short_failsafe() function is set up as below to trigger short failsafe

if(failsafe.rc_failsafe) {
failsafe_short_on_event(FAILSAFE_SHORT, ModeReason::RADIO_FAILSAFE);
}

It didn’t actually use FS_SHORT_TIMEOUT parameter when people lose rc signal. I tried to fix it as below:

if (failsafe.rc_failsafe &&
(tnow - rc_last_seen_ms) > g.fs_timeout_short*1000) {
failsafe_short_on_event(FAILSAFE_SHORT, ModeReason::RADIO_FAILSAFE);
}

(Refer to more details from this pull request)

I’ve tested this in SITL and confirmed that the failsafe now behaves as intended.
Hope this works for everyone, or at least we all finally figure out what happened with short failsafe.

By the way, I was also thinking that since the short failsafe hasn’t been updated for years… Would we consider having GCS lose trigger FS_SHORT_TIMEOUT? Mission planner does mention GCS lose could trigger short failsafe. However, we only designed Long Failsafe for it. If some people consider using pure GCS or GCS&joystick for control, I see no difference from RC usage. Then, a short failsafe for GCS reconnection sounds reasonable.
image

I’m struggling with whether we really need GCS short failsafe. (Already tried to implement this feature on my side.) We have RC short failsafe, RC long failsafe, and GCS (long) failsafe, now. Short Failsafe could refer to a temporary loss rc control, which I guess is more common than losing GCS signal and more important for the usual case. On the other hand, it could refer to a feature that can always restore the last mode once failsafe cleared.