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

Scripted Decision Nodes Importing as Single Line #457

Open
gwizdala opened this issue Dec 2, 2024 · 2 comments
Open

Scripted Decision Nodes Importing as Single Line #457

gwizdala opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@gwizdala
Copy link

gwizdala commented Dec 2, 2024

Frodo CLI version

You are running the homebrew release.
cli: v3.0.0
lib: v3.0.0
node: v20.18.0

Describe the issue

When importing a Journey that contains Scripted Decision Nodes, the import is formatting the script to be a single line. This is resulting in breaking Journeys as the script is likely fully commented out and cannot execute.

Steps to Reproduce

Using the example Journey found here

Importing with the command

frodo journey import -a -f scriptingtutorial_v2.json <tenant>

Importing all journeys from a single file (scriptingtutorial_v2.json)...
✔ Resolved all dependencies.
[========================================] 100% | 3/3 | Finished importing journeys

Results in the Following Journeys being added to your tenant (under Workshop/Scripting):

  1. V2_Scripting1_Outcomes
  2. V2_Scripting2_APIs
  3. V2_Scripting3_Debugging

If you click in on any of these Journeys and select a Scripted Decision Node, you'll find that the script is a single line. For example, V2_Scripting2_APIs -> Coin Flip with API - Next Gen is a single line Script.

If you import the same series of Journeys with the UI, the Journey successfully imports.

@gwizdala gwizdala added the bug Something isn't working label Dec 2, 2024
@vscheuber
Copy link
Contributor

@phalestrivir @hfranklin would you mind taking a peek? I wonder if this might have slipped in with the big changes we made for v3.

@phalestrivir
Copy link
Contributor

I figured out the issue. The problem is due to a change I made in a previous PR. Before my fix, it was doing JSON.parse on the script before an import. What I just realized now is that this is needed to support imports because exports, both from AIC and from Frodo, export the journey scripts as a string within a string, so JSON.parse makes it into a normal string for the import so we don't run into this issue.

The reason I made the change originally was because we were doing the same thing in ScriptOps which was causing problems on import, so I removed it there and also in the journeys thinking it was a problem in the journeys as well. The fix should be as simple as re-adding the JSON.parse in JourneyOps, so I will go ahead and make a PR for that tomorrow.

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

3 participants