-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[FIX] Lusha API Authentication Issue #18889
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughThis pull request updates the Lusha app component with version increments across multiple action modules and refactors the pagination method in the main app file, changing the parameter name from Changes
Sequence DiagramsequenceDiagram
participant Caller
participant paginate as paginate() method
participant API as Lusha API
Note over Caller,API: Old Flow (params-based)
Caller->>paginate: paginate({fn, params={}, maxResults})
paginate->>paginate: payload.pages = params.pages
paginate->>API: _makeRequest(axios config)
API-->>paginate: response
paginate->>paginate: iterate over data
Note right of paginate: Loop until data.length < limit
paginate-->>Caller: results
Note over Caller,API: New Flow (data-based)
Caller->>paginate: paginate({fn, data={}, maxResults})
paginate->>paginate: payload.pages = data.pages
paginate->>API: _makeRequest(axios config, debug:true)
API-->>paginate: response
paginate->>paginate: results = response.data<br/>iterate over results
Note right of paginate: Loop until results.length < limit
paginate-->>Caller: results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs (1)
90-108: Critical: Pagination broken due to params vs data mismatch.The manual pagination loop passes pagination info via
params.pages(lines 95-100), but based on the refactoredpaginatemethod inlusha.app.mjs(line 272), pagination should now be indata.pages. The Lusha API likely expects pagination in the request body, not query parameters.Apply this diff to fix the pagination:
do { const { requestId, data = [], } = await this.lusha.searchContacts({ $, - params: { - pages: { - page, - size: 50, - }, - }, data: { + pages: { + page, + size: 50, + }, filters: { contacts: { include, }, }, }, });components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs (1)
80-98: Critical: Pagination broken due to params vs data mismatch.The manual pagination loop passes pagination info via
params.pages(lines 85-90), but the refactoredpaginatemethod inlusha.app.mjs(line 272) now usesdata.pages. This inconsistency will cause pagination to fail.Apply this diff to fix the pagination:
do { const { requestId, data = [], } = await this.lusha.searchCompanies({ $, - params: { - pages: { - page, - size: 50, - }, - }, data: { + pages: { + page, + size: 50, + }, filters: { companies: { include, }, }, }, });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
components/lusha/actions/company-enrich/company-enrich.mjs(1 hunks)components/lusha/actions/company-search/company-search.mjs(1 hunks)components/lusha/actions/contact-enrich/contact-enrich.mjs(1 hunks)components/lusha/actions/contact-search/contact-search.mjs(1 hunks)components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs(1 hunks)components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs(1 hunks)components/lusha/lusha.app.mjs(2 hunks)components/lusha/package.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/lusha/lusha.app.mjs (4)
components/lusha/actions/company-enrich/company-enrich.mjs (1)
response(32-38)components/lusha/actions/company-search/company-search.mjs (1)
response(78-89)components/lusha/actions/contact-enrich/contact-enrich.mjs (1)
response(32-38)components/lusha/actions/contact-search/contact-search.mjs (1)
response(87-98)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (1)
components/lusha/lusha.app.mjs (1)
182-182: Verify whether hardcoded debug mode is acceptable for production use and whether API key exposure is a known/acceptable trade-off.The Pipedream platform's debug feature intentionally exports the full request configuration (including the
Authorizationheader with the API key) tostep.debug_configwhen enabled. ThecloneSafe()function performs only a deep clone without filtering sensitive data.This hardcoding is atypical compared to how most components use the debug flag (primarily in source/webhook handlers). Since the original concern about API key exposure is technically valid, confirm whether this debug mode is:
- Required for troubleshooting in production
- An oversight that should be removed or made configurable
- An accepted security/observability trade-off for this integration
If debug is not essential for production use, consider removing it or gating it behind an environment variable or component setting.
WHY
Resolves #18861
Summary by CodeRabbit
Chores
Improvements