Skip to content

Update TorController isBootstrapped to match GV's

Discussion from !1423 (comment 3192421)

In a lot of places that use isBootstrapped we should probably be using !TorConnect.shouldShowTorConnect instead, which also checks for TorConnect.enabled. I.e. in cases where TorConnect is not enabled we should be treating the situation as if we are bootstrapped. We had that one user who was using an external tor instance on android, and I think this may become more relevant with Tor VPN on android.

if you do duplicate the logic, can you add a comment to TorConnect.shouldShowTorConnect that any changes should be mirrored in android. Similarly, a comment on the android side that the logic is copied from TorConnect.shouldShowTorConnect.

Alternatively, and maybe more in line with the ownership model we want, we can have an extra signal TorConnectTopics.ShouldShowTorConnectChange, which fires whenever shouldShowTorConnect changes in value. Then on the android side you keep a local copy of shouldShowTorConnect. Fetch it once at startup with shouldShowTorConnectGet, and then update it whenever you receive the signal.

      case lazy.TorConnectTopics.ShouldShowTorConnectChange:
        lazy.EventDispatcher.instance.sendRequest({
          type: EmittedEvents.shouldShowTorConnectChanged,
          show: lazy.TorConnect.shouldShowTorConnect,
        });
        break;

On the desktop side, I can think of at least one case where I would be able to use the same signal.

Sadly in practice, directly calling across the fenix/GV/JS bridges so async doesn't match the use cases we need so I'm for now learning towards a reimplementation and comment, but ran out of time in the parent MR

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information