MTE Relay mobile clients v5.3.1: Android, iOS and Flutter fixes
· 4 min read
Relay 5.3.1 is a patch release of the Android library, the iOS package and the Flutter plugin. It brings the two native libraries into line with each other and with the frame version 2 specification. It works with every v5 relay, and the relay needs no change. We recommend it for every app on 5.3.0.
Fixed on all three
- A body exactly at the relay's cap is sent. The client compared the
encrypted frame with
maxRequestBodyBytes, but the relay counts the body, so bodies from the cap down to about 0.4% under it were refused on the device. Only the body is compared now. pathnamePrefixnames where the relay is mounted, on both platforms. On Android, 5.0 to 5.3.0 added it to the encrypted path and sent the request to the root of the host, so a relay behind a proxy at/relaycould not be reached. Requests now go to<server>/<prefix>/, as on iOS and in 4.x.- Long-lived sessions stay healthy. The client refreshes its token before
the relay's
tokenMaxAgeSecondsruns out. After a long sleep it notices that the relay has dropped its pairs and replaces them under the same client id, measuring on a clock that counts sleep. A manual re-pair hands the old pairs back to the relay instead of leaving them to age out. - The quick-starts said Kyber-512. The clients pair with Kyber-1024, as the relay requires.
Android
callTimeoutandcall.cancel()now end a relayed request within about 100 ms, and fail with what OkHttp throws without a relay. That covers Retrofit and coroutine cancellation too.maxPairs,minPairsandacquisitionWaitTimetake effect. The pool grows on demand, and an open event stream no longer holds up other requests.- A body set with
toRequestBody(mediaType)reaches the origin with itsContent-Type, and repeated headers such asSet-Cookiekeep every value. - Buffered requests and responses near the 64 MiB cap no longer run out of memory.
iOS
- Relay errors run their recovery again. A relay that no longer knows the
session triggers a full repair instead of leaving the client broken until the
app restarts. A refusal reports the relay's own status and reason, for example
relayStatus(481, "body_too_large"), so it can be told apart from a proxy's 413. - A response cut short before the relay's END frame is a failure, not a complete body.
- A relay host that does not resolve fails at once instead of waiting for connectivity. A quiet event stream lasts as long as the relay keeps it open.
- The path reaches your API exactly as written, escapes and trailing slash
included. Cancelling a transfer or hitting its
timeout:stops it and frees its pair.
Flutter
- Errors are typed.
RelayHttpClient, and Dio through it, throwsRelayClientException, anhttp.ClientExceptionthat carries the status, the relay'sreasonand theRelayException. Existingon http.ClientExceptionhandlers still catch it. startUploadandstartDownloadreturn an operation id on both platforms, andcancelOperation(id)stops that transfer.- The Android side no longer adds
READ_PHONE_STATEand storage permissions to your app.
Upgrading
Most apps need no code changes. Check these if they apply to you:
- Android with
pathnamePrefix: the prefix is now where the relay is mounted, not part of your request's path. - Flutter
startUploadandstartDownload: the future now resolves with the operation id when the transfer starts. The outcome arrives as aresponseorfailedevent. - iOS with a zero or negative
timeout:: it now throwsinvalidConfiguration.
implementation("com.eclypses:mte-relay-client-android:5.3.1")
.package(url: "https://github.com/Eclypses/mte-relay-client-ios.git", from: "5.3.1")
mte_relay:
git:
url: https://github.com/Eclypses/relay-client-plugin-flutter.git
ref: v5.3.1
The plugin requires 5.3.1 of both native libraries. See the Android, iOS and Flutter guides, and each library's changelog on GitHub for the full list.