pachli-android/core
Nik Clayton abfd3240bd
fix: Don't lose images / captions when editing with failed uploads (#1054)
Previous code would remove image attachments from the compose editor if
there was a problem uploading or updating them.

This caused a particular problem with image captions. You could attach a
valid image, then write a caption that was too long for the server. The
server would reject the status, and the status was saved to drafts.

Then you open the draft, which tries to upload the image again with a
too-long caption. The upload is rejected, and the image, along with the
caption, is removed.

Fix this.

- Change `QueuedMedia` to track the upload state as a `Result<_,_>`, so
any error messages are preserved and available to the UI.

- The different `Ok` types for the upload state contain the upload
progress percentage (if appropriate) or the server's ID for the uploaded
media.

- Change `ProgressImageView` to accept the upload state `Result`. If the
result is an error the image is drawn with a red overlay and white
"error" icon.

- If an upload is in an error state allow the user to click on it. That
shows a dialog explaining the error, and provides options to edit the
image, change the caption, etc.

- When changing the caption make the API call to change it on the server
(if the attachment has been uploaded). This makes the user aware of any
errors sooner in the process, so they can correct them.

Fixes #879
2024-10-30 14:33:16 +01:00
..
activity fix(l10n): Translations update from Hosted Weblate (#1056) 2024-10-29 15:43:23 +01:00
common refactor: Slightly improve enum extensions and usage (#948) 2024-09-26 16:23:48 +02:00
data fix(l10n): Translations update from Hosted Weblate (#1056) 2024-10-29 15:43:23 +01:00
database refactor: Use Date type for scheduled post date / times (#1032) 2024-10-20 16:29:32 +02:00
designsystem fix(l10n): Translations update from Hosted Weblate (#995) 2024-10-10 21:42:59 +02:00
domain refactor: Move AccountManager to core.data.repository (#976) 2024-10-03 21:28:01 +02:00
model fix: Disable "Scheduled post" support on GoToSocial accounts (#1025) 2024-10-18 15:37:10 +02:00
navigation refactor: Use Date type for scheduled post date / times (#1032) 2024-10-20 16:29:32 +02:00
network fix: Don't lose images / captions when editing with failed uploads (#1054) 2024-10-30 14:33:16 +01:00
network-test test: Ensure that all relevant MastodonAPI methods are stubbed (#1001) 2024-10-13 17:18:54 +02:00
preferences fix(l10n): Translations update from Hosted Weblate (#1056) 2024-10-29 15:43:23 +01:00
testing fix(deps): update dependency org.robolectric:robolectric to v4.13 (#859) 2024-08-21 12:41:16 +02:00
ui fix(l10n): Translations update from Hosted Weblate (#1056) 2024-10-29 15:43:23 +01:00
AndroidManifest.xml refactor: Start creating core modules (#286) 2023-12-04 16:58:36 +01:00