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

feat: Better error when calling expression function on input that is undefined or null #10009

Conversation

michael-radency
Copy link
Contributor

Summary

before
image
after
image

error changed only for null and undefined

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-1454/filterifswitch-nodes-improve-output-panel-error-if-a-field-is-missing

…filterifswitch-nodes-improve-output-panel-error-if-a-field
@michael-radency michael-radency added n8n team Authored by the n8n team node/issue Issue with a node labels Jul 11, 2024
`${functionName}() could not be called on "${String(value)}" type`,
{
description:
'Likely you are accesing a field that does not exist, modify your expression or set a default value',
Copy link
Member

Choose a reason for hiding this comment

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

Slight tweak

You are trying to access a field that does not exist, modify your expression or set a default value

@@ -242,4 +243,31 @@ describe('tmpl Expression Parser', () => {
expect(evaluate('={{ $ifEmpty({a: 1}, "default") }}')).toEqual({ a: 1 });
});
});

describe('Test estend with undefined', () => {
Copy link
Member

Choose a reason for hiding this comment

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

typo... extend

Copy link
Member

@Joffcom Joffcom left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link

cypress bot commented Jul 11, 2024

2 flaky tests on run #5875 ↗︎

0 399 0 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 michael-radency 🗃️ e2e/*
Project: n8n Commit: f690a13b2b
Status: Passed Duration: 04:53 💡
Started: Jul 11, 2024 12:26 PM Ended: Jul 11, 2024 12:31 PM
Flakiness  5-ndv.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > Stop listening for trigger event from NDV Screenshots Video
Flakiness  24-ndv-paired-item.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > resolves expression with default item when input node is not parent, while still pairing items Test Replay Screenshots Video

Review all test suite changes for PR #10009 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@michael-radency michael-radency merged commit 519e57b into master Jul 11, 2024
29 of 32 checks passed
@michael-radency michael-radency deleted the node-1454-filterifswitch-nodes-improve-output-panel-error-if-a-field branch July 11, 2024 12:36
jeanpaul pushed a commit that referenced this pull request Jul 11, 2024
@github-actions github-actions bot mentioned this pull request Jul 17, 2024
@janober
Copy link
Member

janober commented Jul 17, 2024

Got released with n8n@1.51.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/issue Issue with a node Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants