Skip to content

Show a notice when the server ignores an archive - #129

Merged
Tarquinen merged 3 commits into
devfrom
archive-ignored-error
Nov 18, 2026
Merged

Tarquinen merged 3 commits into
devfrom
archive-ignored-error

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Reported by a user: select several sessions, tap Archive, they disappear, then come back.

OpenCode servers before 2.1.0 answer the archive request with success but ignore it. The drawer hid the rows on that success, and the next list refresh brought them back with no explanation.

Now archiving reads the session back after the request. If it is still unarchived, the rows return right away with a notice: "Couldn’t archive 3 sessions. This server doesn’t support archiving. Update OpenCode on your computer."

The notice also replaces the red text row that archive, unarchive and delete failures used at the top of the session list:

  • It floats above New Session, styled like the session's connection pill, and slides in and out without moving the list.
  • Sessions that fail together share one notice instead of naming only the last one.
  • It stays 5 s instead of 3, and TalkBack announces it as a polite live region.
  • iOS still has the red row; docs/parity/drawer.md notes the difference.

The read-back costs one extra GET /api/session/<id> per archive. If that read fails, the archive counts as done, since the server already accepted it. Unarchive is unchanged.

archive-before-after.mp4

Verified

  • scripts/check.sh :server and scripts/check.sh :feature:drawer pass; the new server tests fail without the fix.
  • Emulator against OpenCode 2.0.24: before, three archived rows vanish and return after reopening the app; after, they return at once with the notice, in light and dark.
  • Emulator against OpenCode 2.0.24 with the server frozen: deleting two sessions shows "Couldn’t delete 2 sessions".
  • Emulator against OpenCode 2.3.2, on the first commit: archiving three sessions shows no error and holds after reopening the app. The later commits don't touch that path.
  • A failed unarchive wasn't triggered on a device; it uses the same notice and is covered by the reducer test.

OpenCode servers before 2.1.0 answer the archive PATCH with 204 but leave
the session unarchived. The drawer hid the rows on that success, and they
came back on the next list refresh with no explanation.

Archiving now reads the session back after the PATCH and fails when it is
still unarchived, so the drawer puts the rows back and shows "Couldn’t
archive … This server doesn’t support archiving. Update OpenCode on your
computer."

Verified: scripts/check.sh :server on the VM; the new test fails without
the fix. On an emulator against OpenCode 2.0.24 the rows return with the
error; against 2.3.2 archiving three sessions still succeeds and holds
after leaving and reopening the app.
A failed archive, unarchive or delete showed as red text in a row at the
top of the session list. The row pushed the sessions down and back, named
only the last session when several failed, and ran the reason into the
same sentence.

Now the failure is a floating notice above New Session, styled like the
session's connection pill: a red icon, what failed, then why in grey. It
slides in and out without moving the list, stays 5 s instead of 3, and
sessions that fail together share one notice ("Couldn’t archive 3
sessions").

- DrawerFailure replaces the error strings in HomeFeature.State and
  InboxSidebarFeature.Status.
- The in-list error rows (DrawerListItem.DeletionError and the inbox
  list's error item) are gone.
- The three error strings lose their reason placeholder and gain plurals;
  translations redone.

Verified: scripts/check.sh :feature:drawer. On an emulator against an
OpenCode 2.0.24 server, archiving three sessions shows one notice in light
and dark, and deleting two with the server frozen shows "Couldn’t delete 2
sessions".
After archiving, the app reads the session back to catch servers that
answer 204 without archiving. If that read failed (a dropped connection),
the archive was reported as failed although the server had archived the
session.

Now a failed read-back counts as success; only a session read back
unarchived is an error.

Verified: scripts/check.sh :server. The new test
archivingASessionSucceedsWhenItCannotBeReadBack fails without the change.
@Tarquinen Tarquinen changed the title Show an error when the server ignores an archive Show a notice when the server ignores an archive Nov 18, 2026
@Tarquinen
Tarquinen merged commit 90f26f5 into dev Nov 18, 2026
3 checks passed
@Tarquinen Tarquinen mentioned this pull request Nov 18, 2026

This branch was previously deployed

1 inactive deployment
release — 8566441f Deployed Nov 18, 2026 by Tarquinen via check #426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant