Repository navigation
refactor(stack-supabase): simplify the plaintext-table path from #1544 - #1615
Conversation
…rule ColumnMap.hasEncryptedColumns re-derived the plaintext-table rule from encryptedColumnNames instead of calling tableHasEncryptedColumns, the rule create.ts uses to choose what Encryption receives. It now reads that function once in the constructor, so the two cannot drift. Also routes decryptResults' Supabase-error branch through respond(), and folds the two near-identical test client builders into one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Jmn7nhALwP5BxDDr1reNV
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
This PR has no changeset on purpose. It is an internal refactor with no change in behaviour, and it merges into #1544's branch, which already has the Generated by Claude Code |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation
Reviewed 3c4b37b · posted from Claude Code · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5
Skills: code-review, review-cross-check, review-post
Findings (2): 2 minor — 2 inline, 0 below.
No correctness defects found: the hasEncryptedColumns field, the decryptResults error branch and the shared test helper each behave the same as the code they replace.
Generated by Claude Code
…c fields clientFor took its options as a hand-written union and cast them to never, so a renamed EncryptedSupabaseOptions key no longer failed the build. It now takes a connect callback, keeping the options literal at the makeEncryptedSupabase call where the overloads check it. Also moves ColumnMap.hasEncryptedColumns up with the other public readonly fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Jmn7nhALwP5BxDDr1reNV
Requested by CipherStash · project thread
Summary
Cleanups from a
/simplifypass on #1544. #1544 has merged, so this PR now targetsmain. Nothing changes in behaviour.Changes
column-map.ts:ColumnMap.hasEncryptedColumnsis now a readonly field, set in the constructor fromtableHasEncryptedColumns(table). Before, it worked the answer out again fromencryptedColumnNames. That meant the one rulecreate.tsrelies on was written twice, and the two copies agreed only because of how the constructor loop works. The field sits with the other public readonly fields.query-results.ts: the Supabase-error branch ofdecryptResultsnow builds its response withrespond(), like every other branch.supabase-plaintext-table.test.ts: the near-identicalintrospectedClientanddeclaredClientbuilders are now oneclientFor(connect)helper. Each mode passes its options as a literal straight tomakeEncryptedSupabase, so the factory's overloads still type-check them.Verification
vitest runonsupabase-plaintext-tableandsupabase-encryption-error: 26 passed.databaseUrlin a test literal as a check, andtscfailed on it.pnpm run code:check: no errors.Review notes
There is no changeset because this is an internal refactor with no change in behaviour.
These cleanup findings were left as they are:
encryptionClientnullable for plaintext tables (altitude). That is a wider refactor of the query builder than this pass covers.fakeEnvelopein the ciphertext tests (reuse).fakeEnvelopeis a v2 shape that carries aptplaintext field, and these tests need a realistic v3 envelope.🤖 Generated with Claude Code
https://claude.ai/code/session_012Jmn7nhALwP5BxDDr1reNV
Summary by CodeRabbit