-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Enhance Lusha component with new actions and properties #19531
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?
Enhance Lusha component with new actions and properties #19531
Conversation
- Added new actions: Get Company Recommendations, Get Contact Recommendations, Get Company Signals By IDs, Get Contact Signals By IDs, Search Company Signals, and Search Contact Signals. - Introduced new properties for signal retrieval, including startDate and various signal types. - Updated existing actions to improve functionality and added new methods for single company and contact searches. - Bumped package version to 0.3.0 and updated action versions accordingly.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughAdds multiple new Lusha action modules (signals, searches, recommendations), new constants and app API wrappers to support them, bumps package and several action versions, and adds readOnlyHint annotations to two existing actions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 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: 12
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (17)
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/get-company-recomendations/get-company-recomendations.mjs(1 hunks)components/lusha/actions/get-company-signals/get-company-signals.mjs(1 hunks)components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs(1 hunks)components/lusha/actions/get-contact-signals/get-contact-signals.mjs(1 hunks)components/lusha/actions/get-signal-options/get-signal-options.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/actions/search-company-signals/search-company-signals.mjs(1 hunks)components/lusha/actions/search-contact-signals/search-contact-signals.mjs(1 hunks)components/lusha/actions/single-company-search/single-company-search.mjs(1 hunks)components/lusha/actions/single-contact-search/single-contact-search.mjs(1 hunks)components/lusha/lusha.app.mjs(4 hunks)components/lusha/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.
Applied to files:
components/lusha/lusha.app.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Applied to files:
components/lusha/lusha.app.mjs
🧬 Code graph analysis (6)
components/lusha/actions/get-signal-options/get-signal-options.mjs (13)
components/lusha/actions/company-enrich/company-enrich.mjs (1)
response(32-38)components/lusha/actions/company-search/company-search.mjs (1)
response(123-132)components/lusha/actions/contact-enrich/contact-enrich.mjs (1)
response(32-38)components/lusha/actions/contact-search/contact-search.mjs (1)
response(87-98)components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (1)
response(45-53)components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
response(46-53)components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (1)
response(45-53)components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
response(48-55)components/lusha/actions/search-company-signals/search-company-signals.mjs (1)
response(54-61)components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
response(46-53)components/lusha/actions/single-company-search/single-company-search.mjs (1)
response(34-40)components/lusha/actions/single-contact-search/single-contact-search.mjs (1)
response(90-104)components/lusha/lusha.app.mjs (1)
response(371-374)
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (2)
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (1)
response(45-53)components/lusha/lusha.app.mjs (1)
response(371-374)
components/lusha/actions/get-company-signals/get-company-signals.mjs (5)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
response(48-55)components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
response(29-32)components/lusha/actions/search-company-signals/search-company-signals.mjs (1)
response(54-61)components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
response(46-53)components/lusha/lusha.app.mjs (1)
response(371-374)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (5)
components/lusha/actions/contact-search/contact-search.mjs (1)
response(87-98)components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
response(48-55)components/lusha/actions/search-company-signals/search-company-signals.mjs (1)
response(54-61)components/lusha/actions/single-contact-search/single-contact-search.mjs (1)
response(90-104)components/lusha/lusha.app.mjs (1)
response(371-374)
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (3)
components/lusha/actions/contact-search/contact-search.mjs (1)
response(87-98)components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (1)
response(45-53)components/lusha/lusha.app.mjs (1)
response(371-374)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (2)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
response(46-53)components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
response(46-53)
⏰ 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: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (13)
components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs (3)
1-2: LGTM: Import reordering.The reorganized import order (utilities before app modules) improves code organization without affecting functionality.
8-8: LGTM: Version bump.The patch version increment appropriately reflects the annotation and organizational updates in this action.
9-13: ThereadOnlyHint: trueannotation is accurate—theenrichCompaniesAPI call retrieves enriched company data without modifying records in Lusha's system.components/lusha/package.json (1)
3-3: LGTM!The version bump from 0.2.1 to 0.3.0 appropriately reflects the addition of new actions and features in this PR.
components/lusha/actions/company-search/company-search.mjs (1)
8-8: LGTM!Version bump is appropriate.
components/lusha/actions/contact-enrich/contact-enrich.mjs (1)
7-7: LGTM!Version bump is appropriate.
components/lusha/actions/contact-search/contact-search.mjs (1)
8-8: LGTM!Version bump is appropriate.
components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs (1)
8-12: LGTM!The version bump and addition of
readOnlyHint: trueare appropriate for this search-and-enrich action.components/lusha/actions/company-enrich/company-enrich.mjs (1)
7-7: LGTM!Version bump is appropriate.
components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
27-35: LGTM!The action implementation is clean and straightforward, with appropriate annotations and a clear summary message.
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
1-61: LGTM!The action is well-structured, follows Pipedream conventions, and implements proper error handling. The use of propDefinitions for reusability is appropriate.
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
1-63: LGTM!The action follows the established pattern, uses proper error handling, and integrates well with the Lusha app's extended API surface.
components/lusha/lusha.app.mjs (1)
228-358: LGTM!The new API methods follow the established pattern and integrate cleanly with the existing
_makeRequestinfrastructure. The destructuring ofobjectTypeingetSignalOptionsis handled correctly.
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs
Show resolved
Hide resolved
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/search-contact-signals/search-contact-signals.mjs
Show resolved
Hide resolved
components/lusha/actions/single-company-search/single-company-search.mjs
Show resolved
Hide resolved
components/lusha/actions/single-contact-search/single-contact-search.mjs
Show resolved
Hide resolved
- Introduced SIGNALS_OPTIONS and COMPANY_SIGNALS_OPTIONS constants to standardize signal types and enhance component functionality. - Each constant includes labels and values for various signal categories, improving clarity and usability for users interacting with the Lusha component.
…onent - Introduced two new actions: Get Company Recommendations and Get Contact Recommendations. - Each action allows users to retrieve recommendations based on provided company or contact IDs, with options to exclude certain entries and limit results. - Enhanced error handling for API responses to improve user experience. - Updated documentation links for better guidance on usage.
- Revised the description for the companySignals property to clarify that it pertains to types of company signals to retrieve, enhancing user understanding.
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: 2
♻️ Duplicate comments (1)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1)
57-59: Improve error handling to avoid potential undefined access.The catch block destructures
responsefrom the error object, but if the error doesn't have aresponseproperty (e.g., network errors, timeouts), this could lead to throwing a ConfigurationError with an undefined message.Apply this diff to provide a fallback error message:
- } catch ({ response }) { - throw new ConfigurationError(response?.data?.message); + } catch (error) { + throw new ConfigurationError(error?.response?.data?.message || error.message); }
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs(1 hunks)components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs(1 hunks)components/lusha/lusha.app.mjs(4 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.
Applied to files:
components/lusha/lusha.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.
Applied to files:
components/lusha/lusha.app.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Applied to files:
components/lusha/lusha.app.mjs
🧬 Code graph analysis (2)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1)
components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs (1)
response(45-53)
components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs (1)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1)
response(45-53)
⏰ 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). (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/lusha/lusha.app.mjs (2)
228-350: LGTM - New API methods follow established patterns.The new API methods (
searchSingleContact,searchSingleCompany,getContactSignalsById,searchContactSignals,searchCompanySignals,getContactRecommendations,getCompanyRecommendations) are well-structured and follow the established pattern of wrapping_makeRequestwith appropriate HTTP methods and paths.
203-208: Confirm if client-side validation is needed for startDate format.The
startDateprop currently lacks client-side format validation. It's passed directly to the API without checking the YYYY-MM-DD format specified in the description. Verify whether the Lusha API returns clear, user-friendly error messages for invalid date formats, or if client-side validation should be added to catch format issues before the API call.
components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs
Show resolved
Hide resolved
lcaresia
left a 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.
Hey, have some fixes to do.
components/lusha/actions/get-company-signals/get-company-signals.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/get-contact-signals/get-contact-signals.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/search-company-signals/search-company-signals.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/search-contact-signals/search-contact-signals.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/single-contact-search/single-contact-search.mjs
Outdated
Show resolved
Hide resolved
components/lusha/actions/single-contact-search/single-contact-search.mjs
Show resolved
Hide resolved
- Updated summary messages in get-company-signals, get-contact-signals, search-company-signals, and search-contact-signals actions to include the count of retrieved signals. - Introduced FILTER_BY_OPTIONS constant in single-contact-search for improved filtering options.
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
♻️ Duplicate comments (5)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
54-54: Enhance the summary with additional response details.The summary currently only reports the count of contact signals. Consider including additional context such as the signal types requested, date range applied, or other relevant metadata from the response to provide users with more actionable information.
Based on past review comments requesting more info about the response in the summary.
components/lusha/actions/search-company-signals/search-company-signals.mjs (2)
18-33: Combine the two info alerts into a single prop.Having separate
infoandinfo2props is unconventional and can confuse users. Merge the content into a single alert for better user experience.🔎 Apply this diff to combine the alerts:
info: { type: "alert", alertType: "info", content: `Each company must have at least one identifier:\ \n* Company ID\ \n* Domain Name\ - \n* Company Domain + \n* Company Domain\ + \n\n* Use \`startDate\` to customize the timeframe\ + \n* Companies are matched based on provided identifiers `, }, - info2: { - type: "alert", - alertType: "info", - content: `* Use \`startDate\` to customize the timeframe\ - \n* Companies are matched based on provided identifiers - `, - },Based on past review comments.
62-62: Enhance the summary with additional response details.The summary currently only reports the count of company signals. Consider including additional context such as the signal types requested, date range applied, or other relevant metadata from the response to provide users with more actionable information.
Based on past review comments requesting more info about the response in the summary.
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
56-56: Enhance the summary with additional response details.The summary currently only reports the count of contact signals. Consider including additional context such as the signal types requested, date range applied, or other relevant metadata from the response to provide users with more actionable information.
Based on past review comments requesting more info about the response in the summary.
components/lusha/actions/single-contact-search/single-contact-search.mjs (1)
98-102: Throw ConfigurationError directly for consistency.Throwing a generic
Errorthat gets caught and re-wrapped asConfigurationErroris convoluted. ThrowConfigurationErrordirectly to match the pattern used in other actions and simplify the error handling flow.🔎 Apply this diff to throw ConfigurationError directly:
if (response.contact?.error?.name) { if (response.contact.error.name !== "EMPTY_DATA") { - throw new Error(response.contact.error.message || response.contact.error.name); + throw new ConfigurationError(response.contact.error.message || response.contact.error.name); } summary = "No contact found"; }Based on past review comments.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
components/lusha/actions/get-company-signals/get-company-signals.mjs(1 hunks)components/lusha/actions/get-contact-signals/get-contact-signals.mjs(1 hunks)components/lusha/actions/search-company-signals/search-company-signals.mjs(1 hunks)components/lusha/actions/search-contact-signals/search-contact-signals.mjs(1 hunks)components/lusha/actions/single-contact-search/single-contact-search.mjs(1 hunks)components/lusha/common/constants.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-15T22:01:17.593Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/README.md:45-49
Timestamp: 2025-09-15T22:01:17.593Z
Learning: In Leonardo AI components (and likely other Pipedream components), prefer using info alert props on the component itself rather than detailed "Key Features" sections in README files for action documentation.
Applied to files:
components/lusha/actions/search-company-signals/search-company-signals.mjs
📚 Learning: 2025-01-23T03:55:51.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15376
File: components/monday/sources/column-value-updated/column-value-updated.mjs:17-24
Timestamp: 2025-01-23T03:55:51.998Z
Learning: Alert props in Pipedream components are a special case that do not require a label property, and use the 'content' property as a replacement for description.
Applied to files:
components/lusha/actions/search-company-signals/search-company-signals.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/lusha/actions/search-company-signals/search-company-signals.mjscomponents/lusha/actions/get-company-signals/get-company-signals.mjscomponents/lusha/actions/search-contact-signals/search-contact-signals.mjscomponents/lusha/actions/get-contact-signals/get-contact-signals.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/lusha/actions/search-contact-signals/search-contact-signals.mjs
🧬 Code graph analysis (3)
components/lusha/actions/search-company-signals/search-company-signals.mjs (5)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
response(46-53)components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
response(46-53)components/lusha/actions/company-search/company-search.mjs (1)
response(123-132)components/lusha/lusha.app.mjs (1)
response(371-374)components/lusha/actions/single-company-search/single-company-search.mjs (1)
response(34-40)
components/lusha/actions/get-company-signals/get-company-signals.mjs (2)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
response(48-55)components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
response(29-32)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (4)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
response(46-53)components/lusha/actions/contact-enrich/contact-enrich.mjs (1)
response(32-38)components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
response(29-32)components/lusha/lusha.app.mjs (1)
response(371-374)
⏰ 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: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/lusha/common/constants.mjs (1)
1-44: LGTM!The constants are well-structured and follow the standard pattern for option definitions. The values use consistent camelCase naming and labels are clear and user-friendly.
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
57-59: LGTM: Error handling is appropriate.The error handling correctly uses optional chaining to safely access the error message and throws a ConfigurationError with the API's response message, which is consistent with similar actions in this PR.
| startDate: this.startDate, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`); |
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.
Add defensive check and enhance summary message.
The code accesses response.companies without verifying it exists, which could cause a runtime error if the API returns an unexpected structure. Additionally, a past review comment suggests adding more information about the response in the summary.
🔎 Apply this diff to add a defensive check and enhance the summary:
- $.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`);
+ const companyCount = response?.companies ? Object.keys(response.companies).length : 0;
+ $.export("$summary", `Successfully retrieved signals for ${companyCount} ${companyCount === 1 ? 'company' : 'companies'}`);Based on learnings, ensure the summary message is correctly formatted and informative. As per past review comments, add more info about the response in the summary.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`); | |
| const companyCount = response?.companies ? Object.keys(response.companies).length : 0; | |
| $.export("$summary", `Successfully retrieved signals for ${companyCount} ${companyCount === 1 ? 'company' : 'companies'}`); |
🤖 Prompt for AI Agents
In components/lusha/actions/get-company-signals/get-company-signals.mjs around
line 54, the code assumes response.companies exists and builds the summary
directly from it; add a defensive guard to compute companiesCount safely (e.g.,
const companies = response && response.companies ? response.companies : {};
const count = Object.keys(companies).length) and then update the summary to
include that count plus a small, safe bit of response context (for example
response.status or response.meta or a short JSON.stringify of a limited response
field) so the message becomes informative but not verbose; ensure you handle
missing fields gracefully and avoid dumping the entire response.
Resolves ##19497
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.