Skip to content

[#338] Add RLS SELECT policies for trade_history tables#341

Merged
realproject7 merged 1 commit intomainfrom
task/338-rls-select-trade-tables
Mar 19, 2026
Merged

[#338] Add RLS SELECT policies for trade_history tables#341
realproject7 merged 1 commit intomainfrom
task/338-rls-select-trade-tables

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Adds migration 00018_rls_public_read.sql with public SELECT policies for trade_history, backfill_failures, and backfill_cursor
  • Fixes empty arrays returned by anon Supabase client that broke PriceChart

Test plan

  • Migration applies cleanly (supabase db push or apply in dashboard)
  • npm run typecheck passes
  • PriceChart renders trade data when trade_history has rows

Fixes #338

🤖 Generated with Claude Code

Enable public read on trade_history, backfill_failures, and
backfill_cursor so the anon Supabase client can fetch data
for PriceChart and diagnostics.

Fixes #338

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The PR matches issue #338 exactly and keeps scope to a single migration that adds the required public SELECT policies. I did not find conflicts with existing migrations, and local npm run typecheck passes.

Findings

  • [info] GitHub lint-and-typecheck is still pending at review time, but the same check passes locally.

Decision

Approve because the change is minimal, aligned with the acceptance criteria, and technically sound.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

Reviewed migration 00018_rls_public_read.sql:

  • SQL matches issue #338 spec exactly
  • SELECT-only policies with using (true) — consistent with existing pattern in 00004_rls_public_read.sql
  • RLS already enabled on these tables (confirmed by issue context) — this just adds the missing read policies
  • No write exposure — writes remain restricted to service role
  • CI (lint-and-typecheck) passes

Clean, minimal change. LGTM.

@realproject7 realproject7 merged commit 94c82de into main Mar 19, 2026
1 check passed
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.

[#330] Add RLS SELECT policies for trade_history tables

2 participants