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

fix(editor): Replace more variants of BASE_PATH in static assets #9564

Merged
merged 1 commit into from
May 31, 2024

Conversation

netroy
Copy link
Member

@netroy netroy commented May 31, 2024

Vite upgrade in #9545 has started escaping {{BASE_PATH}} twice for a couple of places. Until we update vite config to escape these strings more reliably, adding this additional replacement on server startup fixes the issue.

Related tickets and issues

https://linear.app/n8n/issue/ADO-2251
#9559

Review / Merge checklist

  • PR title and summary are descriptive

@@ -141,6 +141,7 @@ export class Start extends BaseCommand {
createReadStream(filePath, 'utf-8'),
replaceStream('/{{BASE_PATH}}/', n8nPath, { ignoreCase: false }),
replaceStream('/%7B%7BBASE_PATH%7D%7D/', n8nPath, { ignoreCase: false }),
replaceStream('/%257B%257BBASE_PATH%257D%257D/', n8nPath, { ignoreCase: false }),
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a test to prevent this bug from happening happening ?

Copy link
Member Author

Choose a reason for hiding this comment

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

there are no tests for this file. Considering the amount of work required to refactor this file to be able to test it, I'd much rather spend that time fixing the vite config, and remove the two additional replaceStream calls here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would an integration test making sure the font files load make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

by integration I mean e2e*

Copy link
Member Author

Choose a reason for hiding this comment

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

since this issue only happens for favicon and fonts, we could update one of the e2e tests to assert that the favicon url was loaded. besides that I can't think of any other reliable way to test this via e2e.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would you please try that then if it makes sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Tried to add testing the favicon, but seems not to load with or without the fix, so just let it go for now.

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels May 31, 2024
Copy link
Contributor

@mutdmour mutdmour left a comment

Choose a reason for hiding this comment

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

Approving to unblock fixing this issue

@netroy netroy merged commit d361b42 into master May 31, 2024
22 of 25 checks passed
@netroy netroy deleted the fix-ADO-2251 branch May 31, 2024 12:32
@github-actions github-actions bot mentioned this pull request Jun 3, 2024
@janober
Copy link
Member

janober commented Jun 3, 2024

Got released with n8n@1.44.1

@github-actions github-actions bot mentioned this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants