boomerang-io / flow.service.workflow

The backend for front-end microservice for Boomerang Flow, a no-code, cloud-native workflow automation tool. Built in Java using Sprint Boot
https://useboomerang.io
Apache License 2.0
6 stars 8 forks source link

Workflow Revision API return duplicated records in .config.nodes[] #239

Open shenqinb-star opened 1 year ago

shenqinb-star commented 1 year ago

Describe the bug Workflow Revision API: Get /workflow/workflow/600f50bb6a7d2472a948cbd0/revision/9 API return duplicated records in .config.nodes[].

To Reproduce

  1. Create a Workflow only have 2 steps (exclude the start and end ones)
  2. Check the flow_workflows_revisions collection. In the collection, 2 items in config.node, and 4 items in dag.tasks(include start and end). image
  3. Invoke Get /workflow/workflow/{workflow Id}/revision/{revision}. check the API reposne. 4 records in .config.nodes, but first one and third one are duplicated, second and forth one are duplicated. image

Expected Behavior API only return 2 items in .config.nodes

shenqinb-star commented 1 year ago

@tlawrie @amhudson hi Tyson, ambudson, pls take a look at this issue. I checked the backend code, the reason which cause duplicated items is .config.nodes returned in API is constructed by both.config.nodes of DB collection + .dag.task.properties of DB collection. pls help to clarify it is a bug, or worked as design?

tlawrie commented 1 year ago

Hi @shenqinb-star interesting. I'd have to look into it but maybe @amhudson knows.

Also these endpoints should only be used by the Flow App. For other integrations it should be via the API endpoints. Particularly because we don't version these endpoints, only the API ones, so any changes will just happen.

tlawrie commented 1 year ago

FYI 👀 @gchickma