You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search() plain-object shorthand silently does a full-table scan instead of filtering #1426
The resource search() API accepts a plain object literal — tables.Widget.search({ bucket: 'b1' }) — but silently ignores it as a filter and returns an unconditional full-table scan instead of filtering by the attribute. The correct indexed form is the array-of-conditions shorthand: search([{ attribute: 'bucket', value: 'b1' }]).
The plain-object form neither errors nor warns, so a developer expecting a filtered result gets the entire table back — a silent-wrong result plus a hidden full scan on large tables.
Reproduction
// Expected: only rows where bucket === 'b1'constwrong=awaittables.Widget.search({bucket: 'b1'});// returns ALL rows (full scan)// Correct: array of condition objectsconstright=awaittables.Widget.search([{attribute: 'bucket',value: 'b1'}]);// filtered
search() with the object form returns every row; the bucket key is neither applied as a predicate nor rejected.
Impact
Low–medium. Two failure modes from one call:
Silent-wrong result — the caller believes it filtered, but receives the whole table.
Performance footgun — a full-table scan where an indexed lookup was intended; bites hardest on large tables.
Surfaced incidentally during the QA campaign (QA-184): probe code using the object shorthand was inadvertently full-scanning.
Suggested fix
Either:
DWIM — accept the plain-object form as an equality filter ({attr: val} → [{attribute: attr, value: val}]), or
Fail loud — reject the object form with a clear error pointing at the array-condition form.
At minimum, document the two forms and that the object form is not a filter.
Surfaced by the QA-explorer exploratory campaign. Filed by Claude (Opus 4.8).
Activity