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(core): Prevent calling internal hook email event if emailing is disabled #8462

Merged
merged 12 commits into from
Jan 29, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Jan 26, 2024

Ensure we do not call telemetry event Instance sent transactional email to user If emailing is disabled when resource is shared.

Follow-up to: #8408

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

@netroy netroy left a comment

Choose a reason for hiding this comment

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

couple of more comments

@ivov ivov requested a review from netroy January 29, 2024 13:41
private readonly urlService: UrlService,
private readonly internalHooks: InternalHooks,
Copy link
Member

Choose a reason for hiding this comment

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

we can't do this yet. there is still an annoying circular dependency that'll prevent the app from actually starting up.

Comment on lines 52 to 53
Container.get(UserService).setMailer(mailer);
Container.get(InvitationController).setExternalHooks(externalHooks);
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer not start using this format. All dependencies should be injected, and never modified after that.
To fix this test, we need to move all calls to mockInstance to be before setupTestServer, and that should do the trick.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I had a feeling this was not the way but could not find the answer in a short time.

Copy link

cypress bot commented Jan 29, 2024

3 flaky tests on run #3947 ↗︎

0 339 5 0 Flakiness 3

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project: n8n Commit: 6db306e575
Status: Passed Duration: 03:31 💡
Started: Jan 29, 2024 2:32 PM Ended: Jan 29, 2024 2:36 PM
Flakiness  5-ndv.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Test Replay 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
Flakiness  28-debug.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Debug > should be able to debug executions Test Replay Screenshots Video

Review all test suite changes for PR #8462 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov merged commit 9e93980 into master Jan 29, 2024
30 checks passed
@ivov ivov deleted the prevent-calling-internal-hook-event-if-email-not-sent branch January 29, 2024 15:15
MiloradFilipovic added a commit that referenced this pull request Jan 30, 2024
…error-states

* master:
  fix(editor): Send template id as a number in telemetry events (#8484)
  refactor(core): Replace promisify-d node calls with native promises (no-changelog) (#8464)
  fix(core): Fix stopping and retrying failed executions (#8480)
  feat: Add model parameter to OpenAI embeddings (#8481)
  fix(editor): Disable expression editor modal opening on readonly field (#8457)
  fix(core): Prevent calling internal hook email event if emailing is disabled (#8462)
@github-actions github-actions bot mentioned this pull request Jan 31, 2024
@janober
Copy link
Member

janober commented Feb 2, 2024

Got released with n8n@1.27.2

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