Skip to content

OJ-2949: We don't have to change the entire statemachine just the state we need to can use JSONata #529

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jkunle
Copy link
Contributor

@jkunle jkunle commented Dec 13, 2024

changes

We can incrementally add JSONata, for instance in this case removing the Fetch Current Time lambda and then using JSONata in the choice state only - Check Session Has Not Expired.

Before:
image

After:

image

The Check Session Has Not Expired choice state can be be something like

    "Check Session Has Not Expired": {
      "Type": "Choice",
      "Default": "add attributes",
      "Choices": [
        {
          "Next": "Err: Session Expired",
          "Condition": "{% $floor($millis() / 1000) > $number($states.input.sessionQuery.items[0].expiryDate.N) %}"
        }
      ],
      "QueryLanguage": "JSONata"
    },

Once JSONata is included in one state, the mock test would not work this why it is no longer supported because step function local doesn't understand JSONata. The CheckSessionState mock test in jest has been ignored because of this

We can look into these mock test and move what that test into the AWS integration test to retain some coverage. And remove the Mock test altogether

Use JSONata in the choice state alone and see if the state-machine
works. The idea is prove we can opt in we need it. And not have to
re-write the whole step-function
Because on new functionality the schema is not recognized
So mock test would have to be remove. We can look into
The mock test and re-implement missing coverage if we fill the need
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant