Skip to content

Add restore flow for archived checks - #498

Merged
prestoncabe merged 5 commits into
mainfrom
487-archived-checks-cannot-be-restored-so-their-name-is-permanently-unusable
Sep 8, 2026
Merged

prestoncabe merged 5 commits into
mainfrom
487-archived-checks-cannot-be-restored-so-their-name-is-permanently-unusable

Conversation

@prestoncabe

Copy link
Copy Markdown
Collaborator

Summary

Archived custom checks can now be discovered and restored, so archived names are no longer permanently unusable.

Changes

  • Add archived-check listing and restore API support with ownership and state validation.
  • Show archived checks in a collapsed frontend section with one-click restore.
  • Refresh active and archived lists after archive/restore actions and disable conflicting actions while requests are in flight.
  • Reject archived-list query parameters on published-check requests.
  • Add backend and frontend coverage for archive/restore behavior and resource loading failures.

Validation

  • Builder API EligibilityCheckResourceTest: 18 tests passing.
  • Focused frontend Vitest suite: 5 tests passing.
  • Frontend production build passing.
  • Prettier and git diff checks passing.

prestoncabe and others added 5 commits September 8, 2026 11:40
The Restore button sat outside a confirmation modal, so it stayed live
for the whole request. A double click sent two restore calls; the second
found the check already active, returned 400, and surfaced "Could not
restore check" for a restore that had in fact succeeded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013kjK519eM76gGhLAB8dyZa
Reading a failed Solid resource rethrows, so a failed fetch threw out of
createEffect. The home screen has no ErrorBoundary, so a failure of the
archived list took down a page whose active list had loaded fine.

Check .error before touching the accessor, and cover it with a test that
fails (exit 1 on unhandled errors) without the guard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013kjK519eM76gGhLAB8dyZa
The home screen fetched active and archived checks separately, but both
come from the same Firestore collection filtered on isArchived, so every
page load ran the same query twice and deserialized the same documents
twice.

Replace the archived=true filter with includeArchived=true, which returns
all working checks in one response, and split them in the frontend on the
isArchived field that the entity already carries.

fetchUserDefinedChecks now takes an options object. Its second positional
parameter made it unsafe to hand to createResource, which calls fetchers
as fetcher(source, info) -- the truthy info object would have landed in
the archived slot and silently requested the wrong list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013kjK519eM76gGhLAB8dyZa
includeArchived was only honored inside the working=true branch. A
request for archived checks without it fell through to the published
list, which by construction excludes archived checks -- the caller got
the opposite of what it asked for, with a 200 and no signal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013kjK519eM76gGhLAB8dyZa
@prestoncabe
prestoncabe force-pushed the 487-archived-checks-cannot-be-restored-so-their-name-is-permanently-unusable branch from 27d608b to f2ce812 Compare September 8, 2026 15:40
@prestoncabe
prestoncabe merged commit 6b5a6bf into main Sep 8, 2026
4 checks passed
@prestoncabe
prestoncabe deleted the 487-archived-checks-cannot-be-restored-so-their-name-is-permanently-unusable branch September 8, 2026 15:41
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.

Archived checks cannot be restored, so their name is permanently unusable

1 participant