web-eid / web-eid-webextension

The Web eID browser extension for Chrome, Edge, Firefox and other WebExtensions-compatible browsers
https://web-eid.eu
MIT License
15 stars 18 forks source link

Refact native application connection closing #74

Open taneltm opened 3 months ago

taneltm commented 3 months ago

The way the NativeAppService worked before

It was implemented this way, because initially there was an idea that we could get the signing certificate and request signing in the same native app instance. For various reasons, we decided it was better to start a new native app instance in such a case.
In the current code base, the background/actions don't support such a case anymore.

There was also a bug with the Edge browser which got a temporary fix in #67, however this should no longer be necessary.

The way the NativeAppService works now

The nextMessage now has a throwAfterTimeout: Error argument and the background\actions no longer handle the timeout logic on their own. This way, when the timeout occurs, the nextMessage(...) can run it's cleanup logic.