Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content type attributes with falsey values lead to a value of undefined in event payload #1834

Open
ibarreto opened this issue Jul 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ibarreto
Copy link

ibarreto commented Jul 2, 2024

Describe the bug
There's a bug here where if the value of a property is falsey (false, '', etc.) then separatorExtraction(prop) evaluates to falsey, which would be the case for when we have something like "property$en": false, then the code will evaluate nestedDictExtraction(prop), and that nested dictionary might not be defined in the content type and thus return undefined, so we end up with a property: undefined in the payload.

To Reproduce
Have a content element where the type is boolean and is set to false, where it uses the property$language separator.

Expected behavior
Instead of getting undefined in the payload, we should have false (or the relevant falsey value)

Environment (please complete the following information):

  • Botpress Version: 12.31.8 (but bug has been around for longer)

Additional context
Add any other context about the problem here.

@ibarreto ibarreto added the bug Something isn't working label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant