Skip to content

Deal with the "str:" footgun #304

@larsiusprime

Description

@larsiusprime

In filters and calcs, we have a problem:

"something" as a right-hand-side value is ambiguous -- is it a field named "something" or the string literal "something" ?

So far, we've decided: it's always a field. If you want the string literal, you have to say "str:something"

This works great. It throws an error if the field name is not found and tells you to do "str:something" instead. However, there's a problem in that when we train the user to prepend string literals with "str:", there's an issue when they populate ARRAYS with ["str:something", "str:anotherthing"] because these values will then almost certainly not match anything, and the user's intent will fail silently with no feedback. This is a footgun.

Potential solutions:

  • Detect "str:" in arrays and warn
  • Detect "str:" in arrays, warn, and strip it out
  • Detect "str:" in arrays and throw error

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions