avo icon indicating copy to clipboard operation
avo copied to clipboard

Improve select all query serialization

Open Paul-Bob opened this issue 1 year ago • 0 comments

When the "Select All" feature is used and an action is triggered, we need to reconstruct the complete query within the action request.

image

Since the query might include various filters and custom elements, it’s not simple to rebuild it during the action request. To handle this, we serialize and encrypt the entire query (for security) before passing it along with the action request. (An alternative approach could be to only serialize when "Select All" is pressed, but that’s a discussion for another time.)

We’re always open to feedback and suggestions for improvement.

One alternative might be to extract all the IDs from the query, encrypt them as an array, and then retrieve the records using those IDs.

Originally posted by @Paul-Bob in https://github.com/avo-hq/avo/issues/3151#issuecomment-2298865948

One alternative might be to extract all the IDs from the query, encrypt them as an array, and then retrieve the records using those IDs.

This approach is not suitable for scaling (millions of IDs may break it)

For now, let's make some DX improvements:

### Tasks
- [ ] Add FAQ about why the `query` is serialized
- [ ] Custom error with a link to FAQ when serialization breaks (on development)
- [ ] Add option to disable select all feature

Paul-Bob avatar Aug 21 '24 11:08 Paul-Bob