get-convex / convex-helpers

A collection of useful code to complement the official packages.
MIT License
69 stars 10 forks source link

[RLS] fix error on unique() that returns null #27

Closed ldanilek closed 1 year ago

ldanilek commented 1 year ago

noticed that when you call db.query("table").filter(...).unique() with row-level-security and there are no results, we call the row-level-security read predicate on null, which doesn't match the typescript types and isn't expected. Instead, we should only call the predicate on non-null documents.