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

refactor(core): Simplify Redis client types (no-changelog) #10397

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Aug 14, 2024

  • Remove unused client types: client, bclient, consumer, producer, list-sender, list-received
  • Suffix n8n client types to differentiate them from Bull client types
  • Document remaining client types

Context: https://n8nio.slack.com/archives/C069HS026UF/p1723618011118889

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

@tomi tomi left a comment

Choose a reason for hiding this comment

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

Nice job 👏 Couple suggestions regarding naming things 😇

@@ -0,0 +1,19 @@
export type RedisClient = n8nRedisClient | BullRedisClient;
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is the redis client type (or name?), not the client itself. Maybe we should rename this to RedisClientType and N8nRedisClientType and BullRedisClientType (or *Name?)

* - `publisher(n8n)` to send messages into scaling mode communication channels
* - `cache(n8n)` for caching operations (variables, resource ownership, etc.)
*/
type n8nRedisClient = 'subscriber(n8n)' | 'publisher(n8n)' | 'cache(n8n)';
Copy link
Contributor

Choose a reason for hiding this comment

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

TS types should start with a capital letter, even if it's for a name that is normally written with a lowercase letter

Comment on lines +12 to +18
/**
* Redis client used internally by Bull. Suffixed with `(bull)` at `ScalingService.setupQueue`.
*
* - `subscriber(bull)` for event listening
* - `client(bull)` for general queue operations
* - `bclient(bull)` for blocking operations when processing jobs
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Lovely documentation ❤️

@ivov ivov requested a review from tomi August 15, 2024 08:15
Copy link

cypress bot commented Aug 15, 2024



Test summary

401 0 0 0Flakiness 1


Run details

Project n8n
Status Passed
Commit 092f52e
Started Aug 15, 2024 8:36 AM
Ended Aug 15, 2024 8:41 AM
Duration 04:54 💡
OS Linux Debian -
Browser Electron 118

View run in Cypress Cloud ➡️


Flakiness

e2e/14-mapping.cy.ts Flakiness
1 Data mapping > maps expressions from table header

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud

Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov merged commit 60b15e1 into master Aug 15, 2024
27 checks passed
@ivov ivov deleted the simplify-redis-client-types branch August 15, 2024 08:41
MiloradFilipovic added a commit that referenced this pull request Aug 15, 2024
* master: (22 commits)
  refactor(editor): Type node view event bus (no-changelog) (#10396)
  refactor: Update to license SDK v2.13.1 to address dependency updates (#10422)
  refactor(core): Simplify Redis client types (no-changelog) (#10397)
  fix: Project Viewer always seeing a connection error when testing credentials (#10417)
  fix(editor): Fix incorrect node type version selection on new canvas (no-changelog) (#10412)
  fix(core): Fix payload property in `workflow-post-execute` event (#10413)
  fix: Require mfa code to change email (#10354)
  ci: Remove hard-coded package version in unit tests (no-changelog) (#10414)
  refactor(editor): Remove deleted event name from UI (#10402)
  🚀 Release 1.55.0 (#10411)
  fix: Add better error handling for chat errors (#10408)
  ci: Trigger Docker releases on tag creation instead of release publishing (no-changelog) (#10409)
  fix(AI Agent Node): Fix issues with some tools not populating (#10406)
  feat(AI Transform Node): Telemetry (no-changelog) (#10398)
  feat(AI Transform Node): New node (#10405)
  feat: Add Ask assistant behind feature flag (#9995)
  refactor(editor): Use form event bus everywhere (no-changelog) (#10394)
  fix: Remove node AI Transform node (no-changelog) (#10400)
  fix(editor): Remove `@n8n/permissions` from `n8n-workflow` (no-changelog) (#10399)
  refactor(core): Make new configs consistent (no-changelog) (#10393)
  ...
@janober
Copy link
Member

janober commented Aug 21, 2024

Got released with n8n@1.56.0

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