Commit 224efb1
committed
fix(driver-sql): declare the
Both entry points took `Array<{ name; fields?; tenancy? }>` with no `indexes`,
while `registerManagedObjectMetadata` read the key out of those very objects
through an `(obj as any)` cast and filled `managedObjectIndexes` from it — the
map `syncDeclaredIndexes` renders every declared UNIQUE from. The sibling
`detectManagedDrift` on the same class already declared `indexes?: any[]`, so
the two halves of one class disagreed about the shape of the same input. This
is the shape #4311 fixed for `tenancy`, one key over.
Nothing tripped over it because TypeScript's excess-property check fires on a
fresh object literal and not on one bound to a variable first, and every caller
in the package happened to bind first — a green that held for a reason
unrelated to correctness.
- Add `indexes?: any[]` to `registerObjectMetadata`, `initObjects` and the
shared `registerManagedObjectMetadata` helper, spelled as
`detectManagedDrift` spells it.
- Delete the `as any` at the `managedObjectIndexes.set` read site: the cast was
the evidence that the declaration and the read disagreed.
- Pin the fresh-object-literal form, which is the only form that can go red on
this defect; a variable-bound call measures nothing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBgindexes key initObjects / registerObjectMetadata already read1 parent 2e6a2ea commit 224efb1
3 files changed
Lines changed: 172 additions & 5 deletions
File tree
- .changeset
- packages/drivers/driver-sql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 132 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9599 | 9599 | | |
9600 | 9600 | | |
9601 | 9601 | | |
9602 | | - | |
| 9602 | + | |
9603 | 9603 | | |
9604 | 9604 | | |
9605 | 9605 | | |
| |||
9608 | 9608 | | |
9609 | 9609 | | |
9610 | 9610 | | |
9611 | | - | |
9612 | | - | |
| 9611 | + | |
| 9612 | + | |
9613 | 9613 | | |
9614 | 9614 | | |
9615 | 9615 | | |
| |||
9729 | 9729 | | |
9730 | 9730 | | |
9731 | 9731 | | |
9732 | | - | |
| 9732 | + | |
9733 | 9733 | | |
9734 | 9734 | | |
9735 | 9735 | | |
| |||
9740 | 9740 | | |
9741 | 9741 | | |
9742 | 9742 | | |
9743 | | - | |
| 9743 | + | |
| 9744 | + | |
| 9745 | + | |
| 9746 | + | |
| 9747 | + | |
| 9748 | + | |
| 9749 | + | |
| 9750 | + | |
| 9751 | + | |
| 9752 | + | |
| 9753 | + | |
| 9754 | + | |
| 9755 | + | |
| 9756 | + | |
| 9757 | + | |
| 9758 | + | |
9744 | 9759 | | |
9745 | 9760 | | |
9746 | 9761 | | |
| |||
0 commit comments