Skip to content

Keep the chore list visible when a save fails, and name the schema fix - #160

Merged
mapgie merged 1 commit into
mainfrom
claude/task-due-date-error-v4v8n6
Sep 25, 2026
Merged

mapgie merged 1 commit into
mainfrom
claude/task-due-date-error-v4v8n6

Conversation

@mapgie

@mapgie mapgie commented Sep 25, 2026

Copy link
Copy Markdown
Owner

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 the
whole chore list was replaced by that error with a Retry button.

The root cause is on the Supabase side: the tags table on that project is
missing the due_date (and repeat_unit) columns that chore due dates need.
Those columns ship in supabase/schema.sql as idempotent
ALTER TABLE tags ADD COLUMN IF NOT EXISTS ..., but that migration has to be
run 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

  • Actionable error text. userFacingMessage now 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.
  • A failed action no longer hides the list. Split 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

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

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
@mapgie
mapgie marked this pull request as ready for review September 25, 2026 17:37
@mapgie
mapgie merged commit 823b9f9 into main Sep 25, 2026
6 checks passed
@mapgie
mapgie deleted the claude/task-due-date-error-v4v8n6 branch September 25, 2026 17:37
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.

2 participants