Keep the chore list visible when a save fails, and name the schema fix - #160
Merged
Merged
Conversation
Adding a due date to a chore whose Supabase project lacks the due_date column made the PATCH fail with PostgREST's raw "Could not find the 'due_date' column of 'tags' in the schema cache". Two problems compounded it: the message meant nothing to a user, and the chore list screen treats any error as a failed load, so one failed edit replaced the whole list with a Retry page. - userFacingMessage maps any "schema cache" (PGRST204) error to an actionable line: re-run supabase/schema.sql, which adds the missing columns idempotently. The app cannot run DDL itself. - Split ChoreUiState.error (fatal load, offers Retry) from a new actionError (a failed edit/log/archive/snooze), shown as a snackbar over the list that is still there. Mutation handlers set actionError. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NhTpUM2HrfftXgeEd3G5fc
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.
What happened
Adding a due date to an existing chore failed with the raw PostgREST line
Could not find the 'due_date' column of 'tags' in the schema cache, and thewhole chore list was replaced by that error with a Retry button.
The root cause is on the Supabase side: the
tagstable on that project ismissing the
due_date(andrepeat_unit) columns that chore due dates need.Those columns ship in
supabase/schema.sqlas idempotentALTER TABLE tags ADD COLUMN IF NOT EXISTS ..., but that migration has to berun against the project. The app cannot run DDL itself, so it can't add the
column, but it was making the failure worse in two ways this PR fixes.
Changes
userFacingMessagenow maps any PostgREST"schema cache" error (PGRST204) to: "Your Supabase project is missing a
column this app version needs. In Supabase, open the SQL Editor and re-run
supabase/schema.sql, then try again." Instead of the raw database line.
ChoreUiState.error(a failed load, which still offers Retry) from a new
actionError(a failed edit / log / archive / snooze), shown as a snackbar over the list
that stays put. The six mutation handlers now set
actionError;load()keeps using
error.Tests / checks
UserFacingErrorTestcase for the schema-cache mapping.python3 check_changelog_fragment.pyandpython3 a11y_check.pypass.patch) and aLESSONS.mdentry (fix: AppWidget receivers exported=false blocks system update broadcasts #65).For the user
To actually store due dates on your project, open Supabase, go to
SQL Editor -> New query, paste all of
supabase/schema.sql, and run it(it is idempotent and only adds the missing columns). After that the due date
save will succeed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NhTpUM2HrfftXgeEd3G5fc
Generated by Claude Code