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

Inconsistent/unnecessary escaping of characters in inputs #9859

Open
5 of 6 tasks
nikku opened this issue Jul 21, 2022 · 34 comments
Open
5 of 6 tasks

Inconsistent/unnecessary escaping of characters in inputs #9859

nikku opened this issue Jul 21, 2022 · 34 comments
Assignees
Labels
component/engine component/zeebe Related to the Zeebe component/team impact/high Marks issues relieving a recurring pain or fulfilling an immediate need kind/bug Categorizes an issue or PR as a bug kind/epic Categorizes an issue as an umbrella issue (e.g. OKR) which references other, smaller issues support Marks an issue as related to a customer support request version:8.4.0 Label that represents issues released on verions 8.4.0

Comments

@nikku
Copy link
Member

nikku commented Jul 21, 2022

Describe the bug

As a user I want to pass special chars in strings (FEEL ref) in a way that I can consume them in a job worker.

I've defined the following input mappings:

name value
dynamic_input = "Hello\n\nYOU!"
static_input Hello\n\nYOU!
static_input_explicit_newlines HELLO<newline><newline>YOU!

Executing my process I receive the following input variable values in operate (but also in my process worker):

name value
dynamic_input "Hello\\n\\nYOU!"
static_input "Hello\\\\n\\\\nYOU!"
static_input_explicit_newlines "Hello\\n\\nYOU!"

As you can see inputs are escaped differently depending on whether I use \n encoded newlines or actual newline characters. Escaping happening in the first place is fine I believe as this is a JSON string and \\n is the standard way to encode newlines there.

To Reproduce

  • Deploy + run test process
  • See double escaping happening in string inputs

Expected behavior

We do the unescaping magic ourselves so that in user land no one needs to worry:

  • I define an input mapping foo = "a\nb"
  • In my job worker I see foo = "a\nb"

As a more user un-friendly alternative we could consider: String inputs are escaped like expression inputs (no double escaping), we clearly document how escaped strings shall be worked with (and how un-escaping has to be done in user land). This is closer to the existing behavior.

Log/Stacktrace

none.

Environment:

  • OS: Linux
  • Zeebe Version: 8.0.2
  • Configuration: nothing special

Support:
SUPPORT-15887
SUPPORT-17621

Tasks

Preview Give feedback
  1. area/test kind/bug version:8.4.0 version:8.4.0-alpha2
    nicpuppa
  2. kind/bug version:8.4.0
    nicpuppa
  3. area/test component/zeebe impact/high kind/task
@nikku nikku added the kind/bug Categorizes an issue or PR as a bug label Jul 21, 2022
@nikku
Copy link
Member Author

nikku commented Jul 21, 2022

To add to this I see zeebe escaping unicode characters (i.e. 🤩) despite JSON having full unicode support.

Hello\n\nYOU! 🤩

turns into

"Hello\\n\\nYOU! \uD83E\uDD29"

"Hello\\n\\nYOU! 🤩" is a valid JSON string.

@nikku nikku changed the title Inconsistent escaping of characters in inputs Inconsistent/unnecessary escaping of characters in inputs Jul 21, 2022
@nikku
Copy link
Member Author

nikku commented Aug 15, 2022

Is there a chance this can be fixed at some point? Or do we regard this as a nasty-bug-turned-public-api?

@menski
Copy link
Contributor

menski commented Aug 19, 2022

@felix-mueller this is something which mostly effects connectors but it is very unexpected behavior. We would like to understand if you have any input on priority for this.

@felix-mueller
Copy link
Member

It should be fixed at some point. Since we still need to root-cause and better understand the issue it is probably not S. We won't priotize it for the next few iterations (first we need to finish instance modification, DMN evaluation and delete definitions).

@menski
Copy link
Contributor

menski commented Aug 19, 2022

Thanks Felix, I put the priority on "Later" for now

@darox
Copy link

darox commented Sep 12, 2022

I don't know whether I'm hitting the same issue. I'm using the Go client to ingest JSON formatted data into Zeebe. Jobs are failing due to escaped double quotes. If I set vars manually via simple-monitor everything works as expected.

@igpetrov
Copy link
Contributor

Hi team, is there any ETA to fix this? It is affecting currently 3 connectors.

@felix-mueller
Copy link
Member

@igpetrov currently we have planned to look into it after instance modification, DMN evaluation and Delete Definitions. these topics are scheduled to be included in our April minor release, so if we don't change priorities we probably will look at it in a few months.

from connectors perspective can we live with this for a few months?

@igpetrov
Copy link
Contributor

Hi @felix-mueller, appreciate your update. Absolutely. Just wanted to understand the ETA. Thank you!

@tmetzke
Copy link
Member

tmetzke commented Nov 17, 2022

For reference, in Connectors, we currently do the following to work around this with data we receive as variables after Zeebe has processed the user input:

StringEscapeUtils.unescapeJson(jsonStringVariable)

This uses StringEscapeUtils from org.apache.commons:commons-text.

chillleader pushed a commit to camunda/connectors that referenced this issue Dec 9, 2022
Currently there is a known issue where modeler adds an escape character to special characters. Example: "Hello, World 🤩" will end up as "Hello, World \uD83E\uDD29". This commit forces unescaping. Functionality es expected to be removed after related issues are fixed.

Closes #15.

Refs:
- camunda/camunda#9859
- camunda/camunda-modeler#2031
@nikku
Copy link
Member Author

nikku commented Jan 23, 2023

@felix-mueller The longer we keep such behavior in the core, the harder it will be for people to unbuild their hacks (trying to work with zeebe data). My 2️⃣ 🪙.

@nikku
Copy link
Member Author

nikku commented Feb 13, 2023

A similar issue is reported by a customer through SUPPORT-15887.

@nikku
Copy link
Member Author

nikku commented Feb 13, 2023

I've updated the issue with a clear expected behavior, reflecting https://jira.camunda.com/browse/SUPPORT-15887, but also #9859 (comment) have reported.

@nikku nikku added the support Marks an issue as related to a customer support request label Feb 15, 2023
@menski
Copy link
Contributor

menski commented Feb 17, 2023

Discussed in the planning meeting on 2023-02-17. Right now we don't have capacity to work on this, and deprioritize it as the customer has a workaround available.

@menski menski removed their assignment Feb 17, 2023
@korthout
Copy link
Member

When we work on this, we need to make sure not to break user space when backporting it to patches. We can do this by adding a configuration setting that allows switching between the current (broken) and new (fixed) behaviors. The default should stay the same in patch releases, but in a minor release we can change the default. This should be clearly communicated in the release notes (and blog) so users understand the change.

@abbasadel
Copy link
Contributor

abbasadel commented Jul 25, 2023

This issue was mentioned again in SUPPORT-17621 and blocking connectors team's here

@abbasadel abbasadel added impact/medium Marks issues relieving an occasional pain or fulfilling a reasonable desire and removed impact/medium Marks issues relieving an occasional pain or fulfilling a reasonable desire labels Jul 26, 2023
@korthout
Copy link
Member

When we resolve this issue, please verify whether the fix also resolves:

@abbasadel abbasadel added the impact/high Marks issues relieving a recurring pain or fulfilling an immediate need label Aug 11, 2023
@mschoe
Copy link
Member

mschoe commented Nov 7, 2023

I run into this issue when using the GH outbound connector and create a new issue with a multi line description field. As this is a quite common use case I'm wondering when we are planning to provide a fix. @felix-mueller is this still scheduled for the 8.5 release in April 2024?

@christian-konrad
Copy link
Contributor

Would https://github.com/camunda/product-hub/issues/1040 help here or is it just a quick fix on string behavior?

@saig0
Copy link
Member

saig0 commented Nov 10, 2023

@nicpuppa started to work on this issue by fixing the escaping in the FEEL engine here. We plan to deliver a fix in one of the next patch releases. 🚀

@christian-konrad the FEEL templating is a bigger topic. Let's fix the issue with the escaping first. 👍

@christian-konrad
Copy link
Contributor

Perfect @saig0 ! Thanks

@MaxTru
Copy link
Contributor

MaxTru commented Nov 22, 2023

Hi @abbasadel ,

according to the previous assessment this should have been fixed with this version bump. Can you verify from Zeebe perspective please and update this issue? Thanks

@megglos
Copy link
Contributor

megglos commented Nov 29, 2023

We need to clarify whether this change is breaking, especially in regards to present workaround in other components such as https://github.com/camunda/connector-slack/issues/48 &
https://github.com/camunda/connector-google-drive/issues/20
While for the REST connector no workaround seems to be in place and there a patch by zeebe would resolve the issue.

If it's breaking we may prefer to only release it in the next minor or at least coordinate with the affected components to remove the workaround applied for a patch. But then we have the risk that we have a dependency between patch levels of connectors and zeebe.

@abbasadel will sync with @saig0 on this tomorrow and ping back.

@abbasadel
Copy link
Contributor

Hi everyone, this is Zeebe's assessment:

  • The recent bug fix on the FEEL engine is not backward compatible from Zeebe's point of view. However, we believe, based on @saig0’s feedback and our tests, the impact on our users is low since the recommended workaround we provided was to use unescapeJson API from Apache Commons which handles breaking change.
  • As the previous behavior was wrong, mentioning the new behavior change in the release notes and as an announcement would be needed
  • This FEEL fix should resolve bug, to be validated by Connectors/Operate teams.
  • The support team should also be aware of this FEEL behavior change once release

@MaxTru
Copy link
Contributor

MaxTru commented Nov 30, 2023

Hi everyone, this is Zeebe's assessment:

  • The recent bug fix on the FEEL engine is not backward compatible from Zeebe's point of view. However, we believe, based on @saig0’s feedback and our tests, the impact on our users is low since the recommended workaround we provided was to use unescapeJson API from Apache Commons which handles breaking change.
  • As the previous behavior was wrong, mentioning the new behavior change in the release notes and as an announcement would be needed
  • This FEEL fix should resolve bug, to be validated by Connectors/Operate teams.
  • The support team should also be aware of this FEEL behavior change once release

Thanks @abbasadel . Will you and the ZPA team please ensure that all these things happen? If so, can we please track this via a breakdown and DRI assignments? Why is the issue not in in progress and has no assignee?

@abbasadel abbasadel self-assigned this Dec 1, 2023
@abbasadel
Copy link
Contributor

@MaxTru, we will take care of this issue

@nicpuppa
Copy link
Contributor

nicpuppa commented Dec 1, 2023

Hi everyone, as follow up I created 3 separate issues to reduce the scope and make easier to follow the progress:

In accordance with @abbasadel and @saig0 I will close this issue This issue is still open only for tracking purpose, I mistakenly closed the issue

@nicpuppa nicpuppa closed this as completed Dec 1, 2023
@nicpuppa nicpuppa reopened this Dec 1, 2023
@abbasadel
Copy link
Contributor

Thanks, @nicpuppa, for the updates.

I added the sub-issues into the main issue description for clarity and tracking purpose

@abbasadel
Copy link
Contributor

abbasadel commented Dec 8, 2023

Hi everyone,

@akeller
Copy link
Member

akeller commented Dec 8, 2023

@abbasadel will this be included with the alpha release next week? Since this is a Zeebe task, I'm not sure what the expectation is. When you open your docs PR, please follow our PR template so we can review ASAP if you want it reviewed, merged, and published on Tuesday.

@abbasadel
Copy link
Contributor

Thanks @akeller. The docs PR is already merged

@saig0 saig0 mentioned this issue Dec 21, 2023
14 tasks
ghost pushed a commit that referenced this issue Dec 21, 2023
15696: Dump feel-engine 1.17.4 r=saig0 a=saig0

## Description

Dump the FEEL engine from 1.17.3 to [1.17.4](https://github.com/camunda/feel-scala/releases/tag/1.17.4). 

The new version includes a bug fix that double quotes were escaped in the resulting string value. Read more about the issue [here](camunda/feel-scala#778).

## Related issues

related to #9859
related to #13551



Co-authored-by: Philipp Ossler <[email protected]>
@deepthidevaki deepthidevaki added the version:8.4.0 Label that represents issues released on verions 8.4.0 label Jan 4, 2024
@aleksander-dytko aleksander-dytko added the kind/epic Categorizes an issue as an umbrella issue (e.g. OKR) which references other, smaller issues label Jan 5, 2024
@romansmirnov romansmirnov added the component/zeebe Related to the Zeebe component/team label Mar 5, 2024
@npepinpe
Copy link
Member

npepinpe commented Jun 3, 2024

It seems this can be closed as done? @nicpuppa ?

@nicpuppa
Copy link
Contributor

It seems this can be closed as done? @nicpuppa ?

Sorry, I missed the comment @npepinpe 🙇 . There is still a task to be completed, that is blocked by this FEEL issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/engine component/zeebe Related to the Zeebe component/team impact/high Marks issues relieving a recurring pain or fulfilling an immediate need kind/bug Categorizes an issue or PR as a bug kind/epic Categorizes an issue as an umbrella issue (e.g. OKR) which references other, smaller issues support Marks an issue as related to a customer support request version:8.4.0 Label that represents issues released on verions 8.4.0
Projects
None yet
Development

No branches or pull requests