Repository navigation
bench: replay PostHog#139159 (trunk-merge 35e7c8e) on Ravion posthog-bench - #18
tembo[bot] wants to merge 55 commits into
Conversation
…ising Generation settlement runs after the model call, so raising on a finalized spend row threw away a paid response and failed every activity retry. Non-strict settlement now logs and leaves the finalized totals unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 37cc720f-f056-4ec3-9990-c26c425576cd
A claim held by a person, by hand or through one of their agents, now covers all of their actors. Their other agents and the tasks they started resume it without takeover and can release it. A task counts as its creator only on requests the creator authenticates, because the task id header is caller-supplied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: ec7b2f8a-5d1e-436c-85e7-6cd7baec4202
…backs On an authenticated request the task id header is caller-supplied, so a teammate could name the creator's task and resume a hand claim, or an agent claim the task was already associated with. Those fallbacks now apply only to server-side callers; a request counts a task only through the authenticated person check. Generated-By: PostHog Desktop Task-Id: 3751830c-75a4-47af-bdfd-2130901b9501
…im checks Artefact writes bind a task's work to the active claim, and suggested-reviewer writes check a supplied claim, without the request's authenticated user. A teammate who named the creator's task could still attach notes or reviewer edits to the creator's claim. The task attribution from a request now keeps the authenticated user (not stored, not compared), so every claim check applies the creator rule. Generated-By: PostHog Desktop Task-Id: 3751830c-75a4-47af-bdfd-2130901b9501
…ld they belong to
… remove inside each field
…nder is connected
Generated-By: PostHog Desktop Task-Id: 6afd34cd-a992-4e47-b29e-519f237dd9fc
… popover open for the variable picker
Unverified: trivial Claude-Session: https://claude.ai/code/session_01AovXvaH6YGX2QE2DeouMiz
27 updated Run: 86933f4b-5d10-40c1-8d1b-832684e9bc1c
Move the desktop workspace to posthog-node 6, which sends only to capture v1, and drop the SDK major guard's hold on it. Person processing for app events moves from the legacy $process_person_profile property to the per-event option. Co-authored-by: Anna Garcia <anna.g@posthog.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…compact-email-fields # Conflicts: # products/workflows/frontend/Broadcasts/BroadcastWizard.tsx
|
[High impact] The PR adds a path for email-provider contacts to write people and cohort data. The PR should not merge while contact delivery, cohort completion, opt-out copying, and the two frontend requirements remain unresolved. Reviews (4) · Last reviewed commit: "Merge branch 'bench/base-594616e' into t..." · Reviewed by Greptile |
| raise | ||
|
|
||
| # A caller's transaction can still roll back the cohort, and events sent before that can't be taken back. | ||
| transaction.on_commit(dispatch) |
There was a problem hiding this comment.
Queued contacts are lost. For provider imports,
_save_page commits the page as completed before these callbacks run. If capture_people_import.delay fails, dispatch deletes that chunk's stored rows and raises. Django also skips the remaining callbacks. The retry then exits because _claim_step sees a completed step. A temporary queue outage can therefore lose contacts while the run reports success. Save the dispatch work durably so it can be retried after the page commits.
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/workflows/backend/services/people_import.py
Line: 209
Comment:
**Queued contacts are lost.** For provider imports, `_save_page` commits the page as completed before these callbacks run. If `capture_people_import.delay` fails, `dispatch` deletes that chunk's stored rows and raises. Django also skips the remaining callbacks. The retry then exits because `_claim_step` sees a completed step. A temporary queue outage can therefore lose contacts while the run reports success. Save the dispatch work durably so it can be retried after the page commits.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| # One import holds a bounded number of rows, so a long list fills the cohort in several imports. | ||
| for start in range(0, len(rows), MAX_PEOPLE_IMPORT_ROWS): | ||
| summary = start_people_import( | ||
| team=team, | ||
| user=user, | ||
| name=cohort.name, | ||
| rows=list(rows[start : start + MAX_PEOPLE_IMPORT_ROWS]), | ||
| cohort_id=cohort.cohort_id, | ||
| create_missing=create_people, | ||
| send_events=send_events, | ||
| fill_only=True, | ||
| ) |
There was a problem hiding this comment.
Cohorts finish before every chunk. Lists over 50,000 contacts start several independent imports into the same cohort. Each eventually calls
calculate_cohort_from_list, which clears is_calculating and replaces the import totals for just its own chunk. The first finished chunk makes the cohort page stop polling while other contacts are still missing. The final import totals also describe only one chunk. Track completion and totals across the whole list before marking the cohort ready.
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/workflows/backend/services/provider_contacts.py
Line: 55-66
Comment:
**Cohorts finish before every chunk.** Lists over 50,000 contacts start several independent imports into the same cohort. Each eventually calls `calculate_cohort_from_list`, which clears `is_calculating` and replaces the import totals for just its own chunk. The first finished chunk makes the cohort page stop polling while other contacts are still missing. The final import totals also describe only one chunk. Track completion and totals across the whole list before marking the cohort ready.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| result = _import(context, everyone, create_people=NEW_PEOPLE_STEP in context.steps, send_events=True) | ||
| if result.status == "failed": | ||
| raise ImportStepError(" ".join(result.notes)) | ||
| return SavedPage(imported=result.people, counts={"people": result.people, "contacts": contacts_checked}) |
There was a problem hiding this comment.
Later matches lose opt-outs.
contact_properties matches people again and adds them to the cohort, but never calls carry_opt_outs. During this multi-day import, someone skipped by contacts can register with the same email in different letter casing before the properties step reaches them. That step then adds the person without copying their stored opt-out to the spelling PostHog sends to. Email checks use the exact spelling and allow a missing preference. Carry opt-outs for this step's matched addresses before its events are queued, as save_contact_lists does.
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/messaging/backend/provider_imports/contacts.py
Line: 252-255
Comment:
**Later matches lose opt-outs.** `contact_properties` matches people again and adds them to the cohort, but never calls `carry_opt_outs`. During this multi-day import, someone skipped by `contacts` can register with the same email in different letter casing before the properties step reaches them. That step then adds the person without copying their stored opt-out to the spelling PostHog sends to. Email checks use the exact spelling and allow a missing preference. Carry opt-outs for this step's matched addresses before its events are queued, as `save_contact_lists` does.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const { setEmailTemplateValue } = useActions(emailTemplaterLogic) | ||
| const { integrations, integrationsLoading } = useValues(integrationsLogic) | ||
| const rotationEnabled = useFeatureFlag('WORKFLOWS_EMAIL_SENDER_ROTATION') | ||
| const [customOpen, setCustomOpen] = useState(false) |
There was a problem hiding this comment.
Sender state bypasses Kea. The new
customOpen value uses useState in a scene component. The frontend guide forbids useState and useEffect for local state outside library components under lib/. Move this value and its actions into emailTemplaterLogic or a dedicated Kea logic.
Context Used: Rules for writing frontend code at PostHog (mostly React + Typescript with Kea) (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/scenes/hog-functions/email-templater/QuillEmailHeaderFields.tsx
Line: 291
Comment:
**Sender state bypasses Kea.** The new `customOpen` value uses `useState` in a scene component. The frontend guide forbids `useState` and `useEffect` for local state outside library components under `lib/`. Move this value and its actions into `emailTemplaterLogic` or a dedicated Kea logic.
**Context Used:** Rules for writing frontend code at PostHog (mostly React + Typescript with Kea) ([source](https://github.com/ravionhq/posthog/blob/master/.cursor/rules/react-typescript.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| ) | ||
| } | ||
|
|
||
| function SenderField(): JSX.Element { |
There was a problem hiding this comment.
Header components share one file. The frontend guide requires one component per file, named after its export. This new file also defines
HeaderField, SenderField, and several other components. Split them into feature-local files with named exports.
Context Used: frontend/src/AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/scenes/hog-functions/email-templater/QuillEmailHeaderFields.tsx
Line: 286
Comment:
**Header components share one file.** The frontend guide requires one component per file, named after its export. This new file also defines `HeaderField`, `SenderField`, and several other components. Split them into feature-local files with named exports.
**Context Used:** frontend/src/AGENTS.md ([source](https://github.com/ravionhq/posthog/blob/master/frontend/src/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
@greptile-apps[bot] I'm working on your request now and will update you when I'm done. |
…erge/bench-139159
| return SavedPage( | ||
| imported=result.people, | ||
| counts={ | ||
| "people": result.people, | ||
| "new_people": result.new_people, | ||
| "skipped_new_people": result.skipped_new_people, | ||
| "dropped": result.dropped, | ||
| }, | ||
| items=tuple(items), |
There was a problem hiding this comment.
Failed contacts appear completed
When import_provider_contacts returns status="failed"—for example, because first_name is not writable—save_contact_lists still returns a normal SavedPage. The runner marks Contacts completed, so contact_properties passes its dependency check despite the failure. Without that optional step, the whole run can report success with no contacts imported.
Propagate the failed result to the step before marking it completed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/messaging/backend/provider_imports/contacts.py
Line: 199-207
Comment:
**Failed contacts appear completed**
When `import_provider_contacts` returns `status="failed"`—for example, because `first_name` is not writable—`save_contact_lists` still returns a normal `SavedPage`. The runner marks Contacts completed, so `contact_properties` passes its dependency check despite the failure. Without that optional step, the whole run can report success with no contacts imported.
Propagate the failed result to the step before marking it completed.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Benchmark replay of upstream PostHog merge-queue PR PostHog#139159 (head 35e7c8e, base 594616e) with depot-ubuntu-* runners rewritten to Ravion posthog-bench. Do not merge.