truncating search queries
Okay. Would be cool if it just truncated, failing leaves validation to the user (which is not a huge deal for the user, to be fair). But would be cool if it truncated (and maybe logged a warning).
4 Replies
cool, yeah that makes sense. we also don't expose a function to tokenize the input into a list of terms, so it's not entirely fair for us to make validation the user's responsibility either 🙂
thoughts on what would be your preferred way to receive the warning? perhaps it could log to
console
in dev and silently drop the event in prod? or maybe we could add a new topic to https://docs.convex.dev/production/integrations/log-streams for this set of warnings.Log Streams | Convex Developer Hub
Configure logging integrations for your Convex deployment
When you say drop the event in prod, you mean don't execute the search?
(or fail to execute silently?)
ah, I was thinking we'd truncate the search query and log an event when doing so in dev. then, in prod, we'd truncate the search query as well, returning its results successfully, but then not log an event to the console. thoughts?
Same page 👍 I do think logging could be valuable in prod as I'd ignore the limit unless folks are hitting it a lot, in which case I may need to start handling the limit in-app. But that's just a loose thought, not failing is the main ask.