Files
buzz/mobile/lib/shared/relay/relay.dart
Tom Brow d29c679066 fix(mobile): keep error names in send, upload and invite failure text (#9855)
## Summary

The compose bar's send error, the upload error and the invite page's
error removed the first `Exception: ` anywhere in an error's text, not
just a leading one. A `TimeoutException` read "Timeout..." and a wrapped
error lost part of its text.

They now share the helper Add Members already uses: only a plain
`Exception`'s leading prefix is removed, a relay rejection shows its
message verbatim, a lost acknowledgement drops the prefix only from its
cause, and named types such as `TimeoutException` keep their whole name.
The helper moves to `shared/relay/relay_error_text.dart`; Add Members
behaves as before.

## Validation

- New `relay_error_text_test.dart` covers a plain `Exception`, a
`TimeoutException`, a named error whose message contains `Exception: `,
a relay rejection and a lost acknowledgement. The `TimeoutException` and
named-error rows fail with the old `replaceFirst`.

No screenshots: the change only affects text after a failed send, upload
or invite, which can't be triggered on demand against a real relay.

Full-app run on an iOS simulator (signed in, healthy relay): cold start
and session restore, channel list, opening a channel, sending a message,
the attachment button, Settings, and background then foreground. All
passed with no new errors in the device log. The invite page isn't
offered to the test account.

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
2026-11-22 08:00:17 -08:00

18 lines
536 B
Dart

export 'app_lifecycle_provider.dart';
export 'identity_scoped_prefs.dart';
export 'media_auth.dart';
export 'media_disk_cache.dart';
export 'media_image.dart';
export 'media_upload.dart';
export 'nostr_filters.dart';
export 'nostr_models.dart';
export 'relay_closed_policy.dart';
export 'relay_error_text.dart';
export 'relay_client.dart';
export 'relay_provider.dart';
export 'relay_rate_limit_gate.dart';
export 'relay_reconnect_policy.dart';
export 'relay_session.dart';
export 'relay_socket.dart';
export 'signed_event_relay.dart';