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

Fix: better handling of id replacement #42

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

joepavitt
Copy link
Collaborator

Description

Wasn't supporting subflows and groups. This adds a more universal solution to the ID mapping we do to prevent Node-RED clashes on unchanged nodes.

@joepavitt joepavitt requested a review from Steve-Mcl June 30, 2024 15:48
Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but a little nervous for reasons I cannot yet a valid argument against.

While 99.9% of the time this will work as expected, I cant help but think there may be situations where the id exists as some other value in a node or API key or something.

I was going to suggest the replacement only works when surrounded by double quotes (i.e. strJson.replaceAll('"' + key + '"', '"' + idMap[key] + '"') but something in the back of my mind thinks I am missing something else.

Will let you decided Joe (I may be being over cautious)

@joepavitt
Copy link
Collaborator Author

where the id exists as some other value in a node or API key or something.

even if that's the case, we don't want this new flow pointing to old flow instances, they all need updating.

Will let you decided Joe (I may be being over cautious)

We proceed as is, if new users report problems, we handle them

@joepavitt joepavitt merged commit 58fedfd into main Jul 2, 2024
1 check passed
@joepavitt joepavitt deleted the fix-groups-subflows branch July 2, 2024 07:39
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.

2 participants