Commit Graph

3977 Commits

Author SHA1 Message Date
Gabi
b113a7c519 chore: set same eol for all platforms (#4316)
Kotlin's `spottlessApply` uses the EOL in this file, so it messes up all
line endings if running it from windows without this change.

I don't see a down-side on standardizing this to something fixed for all
platforms and since we're already using LF everywhere I think keeping it
seems like the best.
2024-03-25 23:05:23 +00:00
Jamil
228389882e refactor(connlib): delay initialization of Sockets until we have a tokio runtime (#4286)
Our sockets need to be initialized within a tokio runtime context. To
achieve this, we don't actually initialize anything on `Sockets::new`.
Instead, we call `rebind` within the constructor of `Tunnel` which
already runs in a tokio context.

Fixes: #4282

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-03-25 22:51:35 +00:00
dependabot[bot]
cfc1fb0488 build(deps): Bump tauri-winrt-notification from 0.1.3 to 0.2.0 in /rust (#4300)
```[tasklist]
### Before merging
- [x] Manual test of MSI from CI
```

Bumps
[tauri-winrt-notification](https://github.com/tauri-apps/winrt-notification)
from 0.1.3 to 0.2.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/winrt-notification/releases">tauri-winrt-notification's
releases</a>.</em></p>
<blockquote>
<h2>tauri-winrt-notification v0.2.0</h2>
<p>Updating crates.io index</p>
<!-- raw HTML omitted -->
<pre><code>Fetching advisory database from
`https://github.com/RustSec/advisory-db.git`
Loaded 613 security advisories (from /home/runner/.cargo/advisory-db)
    Updating crates.io index
    Scanning Cargo.lock for vulnerabilities (15 crate dependencies)
</code></pre>
<!-- raw HTML omitted -->
<h2>[0.2.0]</h2>
<ul>
<li><a
href="1427bbfadc"><code>1427bbf</code></a>(<a
href="https://redirect.github.com/tauri-apps/winrt-notification/pull/18">#18</a>)
Update MSRV to <code>1.62</code></li>
<li><a
href="1427bbfadc"><code>1427bbf</code></a>(<a
href="https://redirect.github.com/tauri-apps/winrt-notification/pull/18">#18</a>)
Update <code>windows</code> crate to <code>0.54</code></li>
</ul>
<!-- raw HTML omitted -->
<pre><code>`\`\`
Updating crates.io index
Packaging tauri-winrt-notification v0.2.0
(/home/runner/work/winrt-notification/winrt-notification)
    Updating crates.io index
    Packaged 29 files, 82.9KiB (40.8KiB compressed)
Uploading tauri-winrt-notification v0.2.0
(/home/runner/work/winrt-notification/winrt-notification)
    Uploaded tauri-winrt-notification v0.2.0 to registry `crates-io`
note: Waiting for `tauri-winrt-notification v0.2.0` to be available at
registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available
shortly.
   Published tauri-winrt-notification v0.2.0 at registry `crates-io`
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/winrt-notification/blob/dev/CHANGELOG.md">tauri-winrt-notification's
changelog</a>.</em></p>
<blockquote>
<h2>[0.2.0]</h2>
<ul>
<li><a
href="1427bbfadc"><code>1427bbf</code></a>(<a
href="https://redirect.github.com/tauri-apps/winrt-notification/pull/18">#18</a>)
Update MSRV to <code>1.62</code></li>
<li><a
href="1427bbfadc"><code>1427bbf</code></a>(<a
href="https://redirect.github.com/tauri-apps/winrt-notification/pull/18">#18</a>)
Update <code>windows</code> crate to <code>0.54</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e43754023c"><code>e437540</code></a>
Publish New Versions (<a
href="https://redirect.github.com/tauri-apps/winrt-notification/issues/19">#19</a>)</li>
<li><a
href="1427bbfadc"><code>1427bbf</code></a>
chore(deps): update <code>windows</code> crate to 0.54 (<a
href="https://redirect.github.com/tauri-apps/winrt-notification/issues/18">#18</a>)</li>
<li>See full diff in <a
href="https://github.com/tauri-apps/winrt-notification/compare/tauri-winrt-notification-v0.1.3...tauri-winrt-notification-v0.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tauri-winrt-notification&package-manager=cargo&previous-version=0.1.3&new-version=0.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ReactorScram <ReactorScram@users.noreply.github.com>
2024-03-25 21:51:56 +00:00
Reactor Scram
70c0dc1c97 feat(windows): listen for DNS change events (#4198)
```[tasklist]
- [x] Ensure whatever method we use to read the DNS servers actually works here, and doesn't have a strange memory ordering problem. If it does, read them from the registry by hand.
- [x] Graceful exit
- [x] Error handling
- [x] Clean it up and integrate it with the Tauri client
- [x] Replace `Notify` with channel of size one
- [x] Remove `Arc`
- [x] Replace `close` with panics
- [x] Remove `Pin`
- [x] Unit-test what happens if we register with RegNotify, close the handle, then modify our key
- [x] Merge with main and call `set_dns`
```
2024-03-25 21:18:57 +00:00
Reactor Scram
9c039a449d chore(gui-client): fix doc comment (#4313)
The Tauri client is for both Windows and Linux, though it's not released
on Linux yet.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-25 21:10:49 +00:00
Thomas Eizinger
8f37abb292 chore(connlib): improve wire logs for packets read from and written to device (#4292) 2024-03-25 20:03:28 +00:00
Thomas Eizinger
3f1412cbb8 chore(phoenix-channel): delete stale code (#4295) 2024-03-25 20:00:33 +00:00
Thomas Eizinger
7e68dff5b5 fix(phoenix-channel): re-queue message upon send failure (#4294)
Previously, we would lose one message to the portal upon failing to send
it. We now mitigate this in two ways:

1. We also check the error from `poll_ready` and don't even pop a
message off from our buffer.
2. If sending still fails, we re-queue it to the front of the buffer.

In certain scenarios as discovered in logs from #4058, this might have
caused a loss of the "answer" message from a gateway to the client,
resulting in a state mismatch where the gateway thinks the connection is
established and the client times out on waiting for the answer.
2024-03-25 20:00:18 +00:00
Jamil
cd5cde6ce1 chore(repo): Fix whitespace in MAINTAINERS (#4311) 2024-03-25 13:01:50 -07:00
Andrew Dryga
4844422a31 Fix online status on clients page (#4307)
Closes #4271
2024-03-25 14:00:42 -06:00
Jamil
d4ba178515 Update MAINTAINERS.md
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-25 10:35:53 -07:00
Andrew Dryga
1cb6ab6dc4 chore(Portal): Remove simple forms, change navbar links, fix form styles (#4239)
Closes #4237
Closes #2015

There are new links in the navbar and the floating status badge is
replaced with a link in the burger menu too:


https://github.com/firezone/firezone/assets/1877644/2d72f6d7-a14a-4e56-808d-2e703eca158a
2024-03-25 10:24:24 -06:00
Jamil
486ba52eaf chore(relay): Remove redundant logfilters (#4285)
Addressing feedback from #4280
2024-03-24 13:24:51 +00:00
Jamil
8a09a6f1c8 chore(connlib): Update quinn to pull in iOS fix (#4284)
Reverts https://github.com/firezone/firezone/pull/4279
2024-03-23 18:32:00 -07:00
Gabi
74fc939a3e fix(connlib): use quinn fork for quinn to work on ios (#4279)
Fixes #4276 
WIP
2024-03-23 17:48:24 +00:00
Jamil
5736322440 chore(relay): Reduce staging log level to avoid loss of connectivity (#4280)
`trace` logs are debilitating to the Relay, as it logs for each seen
packet. This reduces the level to `debug` so that the staging Relays are
more closely aligned with the `production` ones.

Ideally, `staging` should have the Relay configuration as `production`,
perhaps after GA.

```
Accepted connection from 172.17.0.2, port 60804
[  5] local 192.168.1.249 port 5201 connected to 172.17.0.2 port 60805
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   149 KBytes  1.22 Mbits/sec                  
[  5]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   2.00-3.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   3.00-4.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  10.00-11.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  11.00-12.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  12.00-13.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  13.00-14.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  14.00-15.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  15.00-16.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  16.00-17.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  17.00-18.00  sec   271 KBytes  2.22 Mbits/sec                  
[  5]  18.00-19.00  sec   470 KBytes  3.85 Mbits/sec                  
[  5]  19.00-20.00  sec   508 KBytes  4.17 Mbits/sec                  
[  5]  20.00-21.00  sec   584 KBytes  4.78 Mbits/sec                  
[  5]  21.00-22.00  sec   501 KBytes  4.11 Mbits/sec                  
[  5]  22.00-23.00  sec   480 KBytes  3.93 Mbits/sec                  
[  5]  23.00-24.00  sec   535 KBytes  4.38 Mbits/sec                  
[  5]  24.00-25.00  sec   514 KBytes  4.21 Mbits/sec                  
[  5]  25.00-26.00  sec   495 KBytes  4.06 Mbits/sec                  
[  5]  26.00-27.00  sec   518 KBytes  4.24 Mbits/sec                  
[  5]  27.00-28.00  sec   499 KBytes  4.09 Mbits/sec                  
[  5]  28.00-29.00  sec   408 KBytes  3.34 Mbits/sec                  
[  5]  29.00-30.00  sec   490 KBytes  4.02 Mbits/sec                  
[  5]  30.00-30.03  sec  18.0 KBytes  4.99 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-30.03  sec  6.29 MBytes  1.76 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
```
2024-03-23 07:01:01 -07:00
Thomas Eizinger
e628fa5d06 refactor(connlib): implement new FFI guidelines (#4263)
This updates connlib to follow the new guidelines described in #4262. I
only made the bare-minimum changes to the clients. With these changes
`reconnect` should only be called when the network interface actually
changed, meaning clients have to be updated to reflect that.
2024-03-23 04:13:05 +00:00
Gabi
703f07fed5 chore(android): prevent from calling setDns and reconnect redundantly (#4278)
Related to changes in #4263
2024-03-23 02:32:14 +00:00
Thomas Eizinger
8c1500d03e chore(connlib): tidy up logs and docs (#4265)
Wrong / outdated docs are worse than no docs. This PR removes some of
these stale docs. We may add new docs at a later point again.
2024-03-23 00:52:24 +00:00
Thomas Eizinger
e8f2320d08 fix(gateway): answer with empty list of addresses on DNS resolution failure (#4266)
Currently, a failure during DNS resolution results in the client hanging
during the connection setup. Instead, we fall back to an empty list
which results in an empty DNS query result for the client.

That in turn will make most application consider the DNS request failed.
As far as I know, we don't currently retry these DNS requests, meaning a
user would have to sign-in and out again to fix this state.

Whilst not ideal, I think this is a better behaviour and what we
currently have where the initial connection just hangs.
2024-03-22 22:16:38 +00:00
Gabi
248abffc2d fix(connlib): never reuse the same sentinel dns (#4275)
Fixes #4273 

Instead of using the random ip and deal with collisions I keep the same
sequential strategy.

Also added some basic unit tests.
2024-03-22 20:38:16 +00:00
Brian Manifold
f5286d0927 feat(portal): Add styled errors pages (404, 422, 500) (#4231)
Closes #2136 

## Screenshots for `404` and `500`

<img width="781" alt="Screenshot 2024-03-20 at 1 16 46 PM"
src="https://github.com/firezone/firezone/assets/2646332/e08e338f-b5b5-4a6a-adb8-b53fe9e8e137">

<img width="916" alt="Screenshot 2024-03-20 at 1 16 30 PM"
src="https://github.com/firezone/firezone/assets/2646332/e19238bf-804d-4f60-bbb3-8cf3f4c89d1f">
2024-03-22 15:26:00 +00:00
Jason Elie Bou Kheir
48b788a46d feat(android): changing managed config restarts TunnelService (#4181)
Fixes #4040

Depends on #4180

---------

Signed-off-by: Jason Elie Bou Kheir <5115126+jasonboukheir@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-22 14:58:52 +00:00
Thomas Eizinger
3fe8f6d3d8 feat(snownet): minimize delay when roaming (#4246)
Currently, we need to wait for the timeout of the current candidate pair
during `reconnect` before we nominate a new one. To speed this up, we
can preemptively invalidate candidates we have previously discovered via
our `Allocation`s, i.e. relay candidates and srflx candidates.
2024-03-22 05:57:48 +00:00
Gabi
e818cb39dd refactor(connlib): don't use Tun::new twice in windows since wintun doesn't like it (#4261)
Should fix the problem with #4198 after hooking `set_dns`
2024-03-22 00:44:40 +00:00
Gabi
4d739a8d27 refactor(connlib): don't recreate the tun device for Apple and Windows (#4260)
This is done to fix a bug where the file descriptor is unregistered from
the reactor after the new `Tun` struct is created if the old one is
dropped after.
2024-03-22 00:12:02 +00:00
Reactor Scram
64f0427ef4 ci(gui-client): hide the Linux GUI deb since it's not ready yet (#4258)
It's still in the CI artifacts for easy testing, but there's no point
letting users see it since it's in the middle of the process split
re-architect
2024-03-21 23:49:34 +00:00
Jamil
251a324c9f chore(ci): Fix tauri upload asset (#4255)
Fixes tauri release builds in CI
2024-03-21 23:47:01 +00:00
Reactor Scram
e3b150cfdb ci(tauri): fix typo (#4256)
You know what I want, when I'm waiting 15-60 minutes on a CI job?

I want a stringly-typed language

I want the compiler to do

as

little

work

as

possible

If there even _is_ a compile step. Cause I love waiting and squinting at
underscores.
2024-03-21 23:00:19 +00:00
Reactor Scram
a6d0a18035 ci(windows): publish Windows Client MSI (#4251)
I think this was just a small regression from the big CI refactor last
week. `update-release-draft` doesn't exist in this file anymore.

Closes #4248
2024-03-21 21:42:07 +00:00
Jamil
71393577ee refactor(connlib): Fix Rust naming typo (#4244) 2024-03-21 16:25:27 +00:00
Jason Elie Bou Kheir
83030a155d test(android): add github action workflow step for unit tests (#4177)
Fixes #2309 

Not sure how to test the workflow itself in this PR 🤔

---------

Signed-off-by: Jason Elie Bou Kheir <5115126+jasonboukheir@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-21 16:25:13 +00:00
Reactor Scram
7fece80006 refactor(gui-client): refuse to ever be elevated on Linux (#4232)
Running as sudo / root causes a lot of problems for GUI programs, so
we're unwinding that. In this case we can go back to using Tauri's "open
URL" function, which is great.

Closes #4103
Refs #3713
Affects #3972 - I was finally able to debug it because it came up
constantly during this PR
2024-03-21 14:42:48 +00:00
Reactor Scram
b0904e382a chore: add crate for privileged Linux tunnel process (#4229)
Refs #3713 

```[tasklist]
### Before merging
- [ ] Is 'firezone-client-tunnel' okay for the binary name?
- [ ] Using a library and building it as two binaries is correct, right? `cargo run -p firezone-client-tunnel` takes 1 second. `cargo run -p firezone-gui-client --bin firezone-client-tunnel` takes 1m42s because it builds all the GUI deps.
```
2024-03-21 14:06:55 +00:00
Reactor Scram
ae5fe281aa refactor(gui-client): reduce scope of a Notify (#4238)
Ran into this while messing with #4232
2024-03-21 14:06:30 +00:00
Jason Elie Bou Kheir
c94b2de02a feat(android): use device serial for deviceName (#4180)
Fixes #4042 

The serial number of the device is blocked behind a permission. There's
a couple ways we can go about this:

-----

### (1) Ask the user to (optionally) grant the permission

When we show the grant VPN permission activity, we also mention the
optional READ_PRIVILEGED_PHONE_STATE permission. Here, the user can
decide to grant it or not, and if they decide not to, they can grant it
in the future in the app settings. When the permission is not granted,
the `deviceName` falls back to the `Build.MODEL`

### (2) Force the user to grant the permission

We keep asking them to grant the permission in the splash view.
`deviceName` is always the serial number of the device.

### (3) Let MDM grant the permission

We don't provide a UI to grant the permission in the application.
Instead, the `deviceName` is the `Build.MODEL` by default, unless
advanced users or admins using MDM set the permission, in which case
it's the serial number of the device.

### (4) Let MDM set a custom/override device name

This could be an alternative to (3) if it is easier for customers using
MDM software to manage it this way. Though I doubt it...

-----

Going with option (3) is safe, and the other options can be added
incrementally in the future. However, it requires communicating to the
customer that they should set this permission for the `deviceName` to be
the serial of the device. That's not a problem yet, since the relevant
customer is using MDM to manage the app; it's trivial to set this
permission via that UI.

If we did want to show this permission to the user, I think option (1)
is most likely going to be better than option (2) in most cases.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-21 12:39:23 +00:00
Thomas Eizinger
45d31e0b62 fix(phoenix-channel): queue join message before others (#4242)
This was discovered as part of
https://github.com/firezone/firezone/pull/4213. When we reconnect to the
portal, we first need to join the correct room before sending any
messages to it. For example, as a client, we need to join the `client`
room before sending messages in it.

This implementation is meant to be a quick fix. The "proper" solution
would be to keep track of which rooms we have joined and reset that upon
reconnect. Introducing such a state machine is a much larger refactoring
that is likely not going to make much of a difference for now because we
only join a fixed number of rooms and that will usually succeed.
2024-03-21 02:17:59 +00:00
Gabi
db62e7bacc feat(android): detect network and dns changes and send them to connlib (#4163)
This completely removes the `get_system_default_resolvers` for android
2024-03-21 02:14:01 +00:00
Gabi
40f5fa3ca2 refactor(connlib): explicitly set DNS from clients instead of requesting it via callback (#4240)
Extracted from #4163

Dependant PRs:
#4198
#4133
#4163
2024-03-21 01:24:10 +00:00
Gabi
7449c9b2d6 chore(connlib): add some additional details about UnallowedPacket (#4241)
ref: #4018 

extracted from #4163
2024-03-21 00:55:18 +00:00
Reactor Scram
9f9e66aec6 chore(gui-client): set author key in the Cargo.toml manifest (#4233)
This fixes a warning about the `Maintainer` field in the deb being
empty, when you install it
2024-03-20 22:21:13 +00:00
Andrew Dryga
29cc0096a8 chore(portal): Fix flaky test and relays load balancing selection (#4230)
A few gifts for @thomaseizinger 

Unblocks
https://github.com/firezone/firezone/pull/4213#issuecomment-2007187811
Closes #3838
2024-03-20 16:33:47 -06:00
Andrew Dryga
8195ac1893 feat(portal): Sync accounts between stripe and portal (#4173)
Closes #3888
2024-03-20 16:32:07 -06:00
Reactor Scram
ada9d896cf chore(gui-client): remove unused env var (#4234)
Must have been a hack to run the smoke test in CI, and was never
actually hooked up.
2024-03-20 22:20:29 +00:00
Andrew Dryga
392adc9e45 fix(portal): Fix various issues with presence-triggered table reloads (#4228)
Also, cover that code with tests.
2024-03-20 14:35:52 -06:00
Reactor Scram
58f1b357d9 refactor(windows): fix cancellation-safety when listening for network events (#4227)
Not sure if this is a fix or a refactor.

Closes #4226
2024-03-20 20:11:14 +00:00
Reactor Scram
e05cbbe0a0 build(gui-client/linux): include an empty firezone-tunnel binary with the Tauri deb package (#4220)
I thought this was going to use `cargo-deb` but it was actually easy
with the Tauri deb bundling we already use.

```[tasklist]
### Before merging
- [x] Make sure every file in the Tauri deb is also in our deb (e.g. icons)
```
2024-03-20 14:11:41 +00:00
Thomas Eizinger
32e0f64b73 refactor(connlib): introduce dedicated ctor for IpProvider (#4206) 2024-03-20 02:16:42 +00:00
Thomas Eizinger
2a46fce574 refactor(connlib): remove Result return values from callbacks (#4158)
Currently, an error returned by `Tunnel::poll_next_event` is only
logged. In other words, they are never fatal. This creates a tricky to
understand relationship on what kind of errors should be returned from
callbacks. Because connlib is used on multiple operating systems, it has
no idea how fatal a particular error is.

This PR removes all of these `Result` return values with the following
consequences:

- For Android, we now panic when a callback fails. This is a slight
change in behaviour. I believe that previously, any exception thrown by
a callback into Android was caught and returned as an error. Now, we
panic because in the FFI layer, we don't have any information on how
fatal the error is. For non-fatal errors, the Android app should simply
not throw an exception. The panics will cause the connlib task to be
shut down which triggers an `on_disconnect`.
- For Swift, there is no behaviour change. The FFI layer already did not
support `Result`s for those callbacks. I don't know how exceptions from
Swift are translated across the FFI layer but there is no change to what
we had before.
- For the Tauri client:
- I chose to log errors on ERROR level and continue gracefully for the
DNS resolvers.
- We panic in case the controller channel is full / closed. That should
really never happen in practice though unless we are currently shutting
down the app.

Resolves: #4064.
2024-03-20 02:09:20 +00:00
Gabi
fa387d0e59 fix(connlib): remove outdated assertion due to possibility of network changes (#4222)
found while working on #4163
2024-03-20 02:05:07 +00:00