Commit 965fb6b
fix(tables): emit isVirtual in the table list and stop over-blocking locked tables
The `/api/table` list handler maps each table to an explicit field whitelist
and never emitted `isVirtual`, so every list-surface gate evaluated `undefined`:
`canMutateTable`/`canRenameTable` left Delete, Rename, Import CSV and Move
enabled on the Memory row, and the trigger-mode filter in the table selector
matched nothing. The existing list test mocked a Memory table without the flag
and asserted everything but it, which is why the gap shipped.
Two grid gates were also over-broad on persisted tables. The `json` escape in
the update-lock check is dead for virtual tables (they early-return above it)
and only changed behavior for persisted update-locked ones, contradicting the
comment directly above. Routing `onOpenConfig` through the blocked-add-column
handler made a schema-locked table's column config unopenable and showed
"add column" copy for something that was not an add — opening a column config
is metadata, not schema.
Finally, a Memory transcript that alone exceeds the page byte budget no longer
fails the whole query. This mirrors `fetchRowsBounded` on the persisted path,
which always yields at least one row for a bounded page and reserves the throw
for unbounded queries where a short page would be silent truncation.
`queryMemoryTableRows` is always bounded, so the guard was unreachable by
design; without this, one long conversation made the table unreadable with no
way to page past it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent c31aaf1 commit 965fb6b
5 files changed
Lines changed: 35 additions & 25 deletions
File tree
- apps/sim
- app
- api/table
- workspace/[workspaceId]/tables/[tableId]/components/table-grid
- lib/virtual-tables
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2287 | 2287 | | |
2288 | 2288 | | |
2289 | 2289 | | |
2290 | | - | |
| 2290 | + | |
2291 | 2291 | | |
2292 | 2292 | | |
2293 | 2293 | | |
| |||
4225 | 4225 | | |
4226 | 4226 | | |
4227 | 4227 | | |
4228 | | - | |
4229 | | - | |
4230 | | - | |
| 4228 | + | |
4231 | 4229 | | |
4232 | 4230 | | |
4233 | 4231 | | |
| |||
Lines changed: 21 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
352 | 358 | | |
353 | 359 | | |
354 | 360 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
0 commit comments