ZupIT/beagle

[iOS] Condition with whitespace

tatianesilvazup opened this issue · 1 comments

BeagleSDK: Could not decode: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "child", intValue: nil), CodingKeys(stringValue: "onInit", intValue: nil), _JSONKey(stringValue: "Index 2", intValue: 2), CodingKeys(stringValue: "onSuccess", intValue: nil), _JSONKey(stringValue: "Index 1", intValue: 1), CodingKeys(stringValue: "condition", intValue: nil)], debugDescription: "Expression cannot be decoded", underlyingError: nil)). Check if that type has been registered.

Description

When there is a condition with global context in the parameters and with whitespace, Beagle can't decode.

Steps To Reproduce

  1. Beagle version - 1.10.1
  2. Write a condition like this condition = "@{eq( global.age, 21 )}"
  3. Run iOS app

Expected Results

Render the screen.

Code example, screenshot, or link to a repository:

        onInit = listOf(
                SetContext(
                        contextId = "global",
                        path = "age",
                        value = 21
                )
        ),
        children = listOf(
                Button(
                        text = "Is equal to 21?",
                        onPress = listOf(
                                Condition(
                                        condition = expressionOf("@{eq( global.age, 21 )}"),
                                        onTrue = listOf(
                                                Alert(message = "The condition is true")
                                        ),
                                        onFalse = listOf(
                                                Alert(message = "The condition is false")
                                        )

                                )
                        )
                )
        )
)```

👋 @tatianesilvazup
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible and that you have followed our contributing guidelines.
We will review it as soon as possible.