Repository navigation
Show a notice when the server ignores an archive - #129
Merged
Merged
Conversation
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.
Closed
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
docs/parity/drawer.mdnotes 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 :serverandscripts/check.sh :feature:drawerpass; the new server tests fail without the fix.