Commit a068a4d
committed
fix(stack): address code-review findings on the v3 type restoration
- operators.test-d.ts: add the negative assertion the changeset claimed but
never made — a `{ encrypt }` double returning `unknown` must be REJECTED by
createEncryptionOperatorsV3. The prior positive `toBeCallableWith(double)`
could not catch a re-erasure (a correct value is assignable to `unknown`), so
the "pinned" guarantee was toothless. The `@ts-expect-error` now goes unused
and fails the moment the client contract regresses to `unknown`.
- query-builder.ts: type `EncryptedFilterState.encryptedValues` as
`EncryptedQueryResult[]`, not `unknown[]`. `encryptCollectedTerms` was restored
to return that type but the value widened straight back to `unknown` at this
field, so the use site (`encryptedValues[i]`) still saw `unknown` — the
restoration never reached the consumer for the base builder. Now it does.
- query-builder-v3.ts: guard the `null` arm in `bulkEncryptGroup`. The restored
`Encrypted | null` type makes null reachable; an unguarded null envelope would
be `JSON.stringify`'d to the literal `"null"` and sent as a filter operand
(matching the wrong rows). Treat it as a contract violation.
- changeset: `patch` → `minor`. Tightening the public `createEncryptionOperatorsV3`
client contract is a compile-time breaking change for loosely-typed downstream
clients; corrected the "no runtime change" line to note the new null guard.
Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w1 parent c4787c0 commit a068a4d
4 files changed
Lines changed: 47 additions & 6 deletions
File tree
- .changeset
- packages/stack
- __tests__/drizzle-v3
- src/supabase
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
50 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
519 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
520 | 532 | | |
521 | 533 | | |
522 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1533 | 1533 | | |
1534 | 1534 | | |
1535 | 1535 | | |
1536 | | - | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
1537 | 1541 | | |
1538 | 1542 | | |
1539 | 1543 | | |
| |||
0 commit comments