n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.12k stars 7.44k forks source link

additional spaces are missed in the JSON output #10418

Open oleksandrborniak opened 2 months ago

oleksandrborniak commented 2 months ago

Bug Description

n8n does not output multiple spaces in JSON output.

To Reproduce

Environment: Doker, Image docker.n8n.io/n8nio/n8n:latest (1.53.2)

Create an Edit Fields node with the following content: "Department": "VZ - PHL - Head Office - G&A"

Or copy-paste this node: { "meta": { "instanceId": "f6951f98b505224e8a04a3bb7be358db57756dc7b87fabf383dcd7473ecd987f" }, "nodes": [ { "parameters": { "assignments": { "assignments": [ { "id": "e2252351-b410-462f-8a69-3ba4cbd5e201", "name": "Department", "value": "VZ - PHL - Head Office - G&A", "type": "string" } ] }, "options": {} }, "id": "cc562aaa-1ae5-4669-bdae-a3bff37944fb", "name": "Edit Fields", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 880, 120 ] } ], "connections": {}, "pinData": {} }

Screenshot 2024-08-14 at 19 03 13

Execute Node and switch on the JSON tab. Try to find "VZ - PHL - Head Office - G&A"

Screenshot 2024-08-14 at 19 06 26

You can notice that the JSON value is different: JSON value: "VZ - PHL - Head Office - G&A" Original value: "VZ - PHL - Head Office - G&A"

The original value has two spaces after "Office" and two spaces before "G&A" JSON value has one space after "Office" and one space before "G&A"

Test workflow: TMP.json

Screenshot 2024-08-14 at 20 04 49

Expected behavior

JSON does not miss additional spaces.

Operating System

Ubuntu 22.04.4 LTS

n8n Version

1.54.2

Node.js Version

20.15.0

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 2 months ago

Hey @oleksandrborniak,

We have created an internal ticket to look into this which we will be tracking as "GHC-161"

oleksandrborniak commented 2 months ago

Thank you.

oleksandrborniak commented 2 months ago

Hey @Joffcom, I'm just checking in to see if you've had a chance to reproduce the issue and confirm whether it's a bug.

Joffcom commented 2 months ago

Hey @oleksandrborniak,

I have just taken a look and on the latest 1.55.3 release this doesn't appear to be an issue.

image

Can you try updating and see if you have the same problem.

oleksandrborniak commented 2 months ago

The result is the same. Just compare visually the two values and let me know if you see a difference.

Screenshot 2024-08-20 at 13 29 06

Firefox:

Screenshot 2024-08-20 at 13 34 31

Chrome:

Screenshot 2024-08-20 at 13 29 43

I expect to see something like this:

Screenshot 2024-08-20 at 13 38 35

I can see the exact difference in spaces in this example ^

https://github.com/user-attachments/assets/a678e813-1e5c-4df0-8cb4-9d2617768018

Joffcom commented 2 months ago

Hey @oleksandrborniak

Looking at it in the JSON view it looks like one space but if I search for VZ - PHL - Head Office - G&A it is showing the correct value, If I click on the pencil icon to edit the data as well I can also see the 2 spaces are there.

image


Looking at this again I have just realised the issue is not with the functionality it is just that the space characters are not clearly displayed.

I will get this moved to the correct team to fix in a future version.

oleksandrborniak commented 2 months ago

Great. Thanks.