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

name attribute is lost sometimes for setHeader #518

Closed
lhein opened this issue Dec 6, 2023 · 3 comments · Fixed by #536
Closed

name attribute is lost sometimes for setHeader #518

lhein opened this issue Dec 6, 2023 · 3 comments · Fixed by #536
Assignees
Labels
bug Something isn't working canvas/config-form Configuration form related issues
Milestone

Comments

@lhein
Copy link
Contributor

lhein commented Dec 6, 2023

  1. Create a new route
  2. add a setHeader
  3. configure expression language JQ
  4. set the expression to .id
  5. set the result type to "java.lang.String"
  6. set the name field to "id"
  7. enable "trim" checkbox
  8. add another setHeader
  9. configure expression language JQ
  10. set the expression to .name
  11. set the result type to "java.lang.String"
  12. set the name field to "name"
  13. enable "trim" checkbox
  14. select the former setHeader to open the config panel
  15. see that the name field is now blank
  16. select the later setHeader
  17. see that the name field is now blank too
@lhein lhein converted this from a draft issue Dec 6, 2023
@lhein lhein added this to the 2.0.0 milestone Dec 6, 2023
@lhein lhein added bug Something isn't working canvas/config-form Configuration form related issues labels Dec 6, 2023
@lhein lhein moved this from New to Todo in Kanban Board Dec 6, 2023
@apupier
Copy link
Member

apupier commented Dec 7, 2023

setHeaderBug

@lordrip
Copy link
Member

lordrip commented Dec 8, 2023

Edited the reproduction steps as the problem comes from updating the expression field AFTER editing the endpoint parameters.

This happens because the ExpressionField has stale data from the node, effectively removing any configuration made before editing the expression.

Alternatively, if the expression is completely adjusted and after that, the endpoint parameters are adjusted, the issue is not present.

This issue will behave the same for the DataFormatEditor

@lhein
Copy link
Contributor Author

lhein commented Dec 8, 2023

Good find.

lordrip added a commit to lordrip/kaoto that referenced this issue Dec 8, 2023
Currently, the ExpressionEditor and DataFormatEditor hold stale data
about the selected node, hence forcing the node update with old data.

The issue behaves as the following:

1. The user updates the expression field using the ExpressionEditor
2. After that, a change in an endpoint parameter is made
3. Another update is made in the ExpressionEditor
At this point, the ExpressionEditor doesn't know the latest change from
the endpoint parameters, hence updating the model with stale information
and ignoring the pending changes.

The fix is to refresh the data in the ExpressionEditor before making the
changes.

This issue will behave the same for the `DataFormatEditor`

fix: KaotoIO#518
@lordrip lordrip self-assigned this Dec 8, 2023
@lordrip lordrip moved this from Todo to In Review in Kanban Board Dec 8, 2023
@lhein lhein closed this as completed in #536 Dec 8, 2023
lhein pushed a commit that referenced this issue Dec 8, 2023
Currently, the ExpressionEditor and DataFormatEditor hold stale data
about the selected node, hence forcing the node update with old data.

The issue behaves as the following:

1. The user updates the expression field using the ExpressionEditor
2. After that, a change in an endpoint parameter is made
3. Another update is made in the ExpressionEditor
At this point, the ExpressionEditor doesn't know the latest change from
the endpoint parameters, hence updating the model with stale information
and ignoring the pending changes.

The fix is to refresh the data in the ExpressionEditor before making the
changes.

This issue will behave the same for the `DataFormatEditor`

fix: #518
@github-project-automation github-project-automation bot moved this from In Review to Done in Kanban Board Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working canvas/config-form Configuration form related issues
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants