-
Notifications
You must be signed in to change notification settings - Fork 5.5k
13314 components popupsmart #18946
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?
13314 components popupsmart #18946
Conversation
… requests, and introduce a new source for emitting popup form data events.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughThe PR introduces a PopupSmart polling source for new popup form data, adds API helpers and pagination to the PopupSmart app, bumps the package version to 0.1.0 with a dependency on Changes
Sequence Diagram(s)sequenceDiagram
actor Timer
participant Source as new-popup-form-data
participant App as popupsmart.app
participant API as PopupSmart API
participant DB as Database
Timer->>Source: trigger (deploy or interval)
Source->>DB: _getLastDate()
DB-->>Source: lastDate
Source->>App: paginate(fn=listLeads, params...)
loop per page
App->>API: GET /api/leads?limit=100&offset=...
API-->>App: leads page
App-->>Source: yield lead (one-by-one)
end
Source->>Source: filter leads by date > lastDate (reverse order)
Source->>Source: emit event(id, summary, ts) for each matching lead
Source->>DB: _setLastDate(new latest date)
DB-->>Source: saved
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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: 2
🧹 Nitpick comments (1)
components/popupsmart/sources/new-popup-form-data/new-popup-form-data.mjs (1)
34-63: Consider explicit date sorting for reliability.The code assumes the API returns leads in descending date order (newest first) when setting
lastDatefromresponseArray[0](line 54) and when reversing for emission (line 56). If the API doesn't guarantee this order or changes in the future, both thelastDatetracking and event emission order will be incorrect.Consider adding explicit sorting after building the response array:
let responseArray = []; for await (const lead of leads) { if (Date.parse(lead.date) > lastDate) { responseArray.push(lead); } } // Sort by date descending to ensure correct lastDate tracking responseArray.sort((a, b) => Date.parse(b.date) - Date.parse(a.date)); if (responseArray.length) { this._setLastDate(Date.parse(responseArray[0].date)); } for (const item of responseArray.reverse()) {This makes the code more robust and independent of API ordering guarantees.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
components/popupsmart/package.json(2 hunks)components/popupsmart/popupsmart.app.mjs(1 hunks)components/popupsmart/sources/new-popup-form-data/new-popup-form-data.mjs(1 hunks)components/popupsmart/sources/new-popup-form-data/test-event.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/popupsmart/sources/new-popup-form-data/test-event.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/popupsmart/popupsmart.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/popupsmart/popupsmart.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: The Salesloft API list endpoints (listPeople, listCadences, listUsers, listAccounts) return arrays directly in the response body, not wrapped in a metadata object with a nested data property. The _makeRequest method correctly returns response.data which contains the arrays that can be mapped over directly in propDefinitions.
Applied to files:
components/popupsmart/popupsmart.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/popupsmart/package.json
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/popupsmart/sources/new-popup-form-data/new-popup-form-data.mjs
🧬 Code graph analysis (1)
components/popupsmart/popupsmart.app.mjs (1)
components/popupsmart/sources/new-popup-form-data/new-popup-form-data.mjs (1)
leads(36-42)
⏰ 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: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/popupsmart/package.json (1)
3-16: LGTM!The version bump to 0.1.0 is appropriate for the new source component functionality, and the @pipedream/platform dependency is correctly added to support the new API helpers.
components/popupsmart/sources/new-popup-form-data/test-event.mjs (1)
1-31: LGTM!The test event payload is comprehensive and includes all relevant fields for a popup form submission event. The structure aligns well with the source component's expectations.
components/popupsmart/popupsmart.app.mjs (1)
8-31: LGTM!The API helper methods are well-structured. The
_baseUrl,_headers, and_makeRequestmethods provide a clean abstraction for authenticated API calls, andlistLeadscorrectly delegates to_makeRequest.components/popupsmart/sources/new-popup-form-data/new-popup-form-data.mjs (2)
12-33: LGTM!The props configuration and state management methods (
_getLastDateand_setLastDate) are well-structured and follow Pipedream patterns correctly.
65-74: LGTM!The
deployhook andrunmethod follow standard Pipedream polling source patterns. The deploy hook correctly fetches an initial batch of 25 items, while the run method processes all new items on each timer execution.
components/popupsmart/sources/new-popup-form-data/new-popup-form-data.mjs
Outdated
Show resolved
Hide resolved
… handling and improve performance by eliminating unnecessary array creation.
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.
LGTM! Ready for QA!
For Integration QA: |
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
Resolves #13314
Summary by CodeRabbit
New Features
Chores