-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Return clickId when event already backfilled #2490
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes introduce and update the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API (POST handler)
participant Tinybird Pipe
participant Redis
Client->>API (POST handler): Send payload with entries
API (POST handler)->>Tinybird Pipe: getFramerLeadEvents(linkIds)
Tinybird Pipe-->>API (POST handler): Return lead events for linkIds
loop For each payload entry
API (POST handler)->>Redis: Check if backfilled (externalId:eventName)
Redis-->>API (POST handler): Backfill status
alt Link missing
API (POST handler)-->>Client: Mark entry invalid (missing link)
else Already backfilled
API (POST handler)-->>Client: Mark entry invalid (already backfilled) + attach clickId
end
end
API (POST handler)-->>Client: Return results
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 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 (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Pull Request Overview
This PR updates the backfill workflows to accept multiple link IDs and surfaces the clickId for events that have already been backfilled.
- Switches the Framer pipeline to use a
linkIdsparameter (string or array) in both scripts. - Returns
clickIdfor entries marked “Already backfilled.” in the batch route.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/web/scripts/framer/backfill-remainder.ts | Changed getFramerLeadEvents to take linkIds (string or array) and updated its invocation. |
| apps/web/app/(ee)/api/cron/framer/backfill-leads-batch/route.ts | Duplicated pipeline definition; added clickId to invalid entries and reordered checks. |
Comments suppressed due to low confidence (4)
apps/web/scripts/framer/backfill-remainder.ts:14
- Duplicate definition of
getFramerLeadEventspipeline appears in two locations; extracting this into a shared module (e.g.,lib/tinybird) would reduce code duplication and keep both callers in sync.
const getFramerLeadEvents = tb.buildPipe({
apps/web/scripts/framer/backfill-remainder.ts:19
- Consider adding unit tests for this transform to verify correct behavior when passing a single string, a comma-separated string, and an array of strings.
.transform((v) => (Array.isArray(v) ? v : v.split(",")))
apps/web/app/(ee)/api/cron/framer/backfill-leads-batch/route.ts:102
- [nitpick] Using
Array.mappurely for side effects can be misleading; switch toforEachor afor...ofloop to clarify intent.
originalPayload.map((p, index) => {
apps/web/app/(ee)/api/cron/framer/backfill-leads-batch/route.ts:120
- [nitpick] The message "Already backfilled." is rather generic; consider honing it (e.g., "Event already backfilled") and/or including the associated link ID for clearer debugging.
error: "Already backfilled.",
Summary by CodeRabbit