Skip to content

Connect Hexclave and Stripe billing analytics to PostHog - #9702

Merged
lawrencecchen merged 19 commits into
mainfrom
task-stack-stripe-posthog-identity
Aug 6, 2026
Merged

lawrencecchen merged 19 commits into
mainfrom
task-stack-stripe-posthog-identity

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • identify signed-in web sessions in PostHog with the canonical Hexclave/Stack user id
  • emit idempotent Stripe billing lifecycle events against the same identity, including plan, status, amount, and Stripe join keys
  • preserve anonymous funnels, keep analytics failures non-authoritative, and disclose account-linked billing analytics in every privacy-policy locale

Testing

  • cd web && bun run typecheck
  • cd web && bun test tests/stack-analytics-identity.test.ts tests/analytics-identity-route.test.ts tests/stripe-billing-analytics.test.ts tests/stripe-webhook-route.test.ts (21 passed)
  • cd web && bunx eslint ... (changed files)
  • cd web && bun run build
  • full web suite: 1,149 passed, 147 skipped, 6 pre-existing client-config-env failures reproduced on origin/main

Research

  • Hexclave user IDs remain the server-issued identity across authenticated SDK and analytics flows.
  • PostHog requires one distinct id across browser and server events; server billing events use $insert_id for retry deduplication and $set for current subscription properties.
  • Stripe remains billing source of truth; PostHog receives analytics projections only.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Connect Hexclave/Stack identity to posthog-js and join Stripe billing analytics on the same distinct id. Gate analytics until a server-authenticated identity resolves or times out; buffer during revalidation; drop buffered events on account change; replay only when the identity is stable; billing analytics send async so payments never block.

  • New Features
    • Identify signed-in sessions via /api/analytics/identity using Stack cookie tokens; observe auth with @stackframe/stack (StackProvider); backfill plan; reset on sign-in/out; anonymous checkout stays anonymous; passive refreshes fail-closed.
    • Gate posthog-js with before_send until identity resolves; add timeout and abortable gating; buffer pageviews/autocapture during revalidation; persist stack_user_id in PostHog/local storage; coalesce refresh; drop buffered events across account changes; replay only when identity matches.
    • Capture idempotent, order-independent Stripe checkout/subscription/invoice events to PostHog; join to user/team $groups; set $insert_id and $set; defer with next/server after (2s cap); emit only for active subscriptions; failures never affect entitlements.

Written for commit 115cf74. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Signed-in activity is now associated with account identities while anonymous sessions remain protected.
    • Analytics captures pageviews, checkout, subscription, and invoice payment events with relevant billing details.
    • Billing analytics runs asynchronously without affecting successful payment updates.
  • Documentation
    • Privacy policies across supported languages now describe analytics, billing, and Stripe identifier collection.
    • Retention, deletion, and legal-retention terms were clarified, including periods of up to 24 months.
  • Tests
    • Added coverage for identity handling, logout behavior, billing event mapping, deferred processing, and analytics failures.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds Stack identity synchronization, Stripe billing event capture through PostHog, deferred webhook integration, tests, and updated PostHog disclosures across localized privacy policies.

Changes

Analytics tracking

Layer / File(s) Summary
Stack identity synchronization
web/app/[locale]/posthog.tsx, web/app/api/analytics/identity/route.ts, web/services/analytics/stackIdentity.ts, web/tests/*identity*
Pageview tracking resolves the current Stack user before capture. The route returns private, non-cacheable responses. Signed-in identities persist in browser storage and reset after logout.
Stripe billing analytics
web/services/analytics/stripeBilling.ts, web/app/api/stripe/webhook/route.ts, web/tests/stripe-*
Supported checkout, subscription, and invoice events map to PostHog billing events. Webhook processing defers capture until successful processing completes.
Localized privacy disclosures
web/app/[locale]/(legal)/privacy-policy/content/*.json
Localized policies document account-linked analytics, billing lifecycle events, Stripe identifiers, retention, and deletion behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PageviewTracker
  participant AnalyticsIdentityRoute
  participant Stack
  participant StackAnalytics
  PageviewTracker->>AnalyticsIdentityRoute: Request current identity
  AnalyticsIdentityRoute->>Stack: Read authenticated user
  Stack-->>AnalyticsIdentityRoute: User ID and plan
  AnalyticsIdentityRoute-->>PageviewTracker: Return private identity response
  PageviewTracker->>StackAnalytics: Synchronize identity and capture pageview
Loading
sequenceDiagram
  participant Stripe
  participant StripeWebhookRoute
  participant StripeBillingAnalytics
  participant PostHog
  Stripe->>StripeWebhookRoute: Send billing webhook
  StripeWebhookRoute->>StripeBillingAnalytics: Defer mapped event capture
  StripeBillingAnalytics->>PostHog: Capture billing event
Loading

Possibly related PRs

  • manaflow-ai/cmux#9699: Both PRs modify Stripe webhook subscription processing with post-update side effects.
  • manaflow-ai/cmux#9707: Both PRs touch Stripe billing lifecycle handling and shared webhook route tests.
🚥 Pre-merge checks | ✅ 23 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers the summary and testing, but it omits the required Demo Video, Review Trigger, and Checklist sections. Add the missing template sections, include a demo video or state why none applies, and complete the review and checklist items.
✅ Passed checks (23 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed The PR diff contains TypeScript and JSON changes only; no Swift files or Swift actor-isolation declarations are changed.
Cmux Swift Blocking Runtime ✅ Passed The complete PR range contains no changed Swift files and no listed blocking-runtime primitives; the changes are confined to web TypeScript, JSON, and tests.
Cmux Browser Automation Off-Main ✅ Passed The PR diff contains no changes to TerminalController.swift, the socket-worker policy, or policy tests, and adds no browser socket automation command.
Cmux Expensive Synchronous Load ✅ Passed The PR-range diff contains only web JSON/TypeScript files and zero .swift paths, so the Swift-only expensive synchronous load check is not applicable.
Cmux Cache Substitution Correctness ✅ Passed The diff adds a no-store authoritative identity read before each pageview; localStorage only tracks a prior ID for reset, and no persistence, history, undo, or snapshot path swaps in a cache.
Cmux No Hacky Sleeps ✅ Passed The PR adds no sleep, polling, or wall-clock synchronization. PostHog uses bounded AbortSignal.timeout(2000), and Stripe analytics uses Next.js after() after database completion.
Cmux Algorithmic Complexity ✅ Passed The production diff adds no loops, sorting, filtering, or per-record scans; it uses fixed event branching and scalar identity/storage lookups. The only Map is test-only scaffolding.
Cmux Swift Concurrency ✅ Passed The PR diff against origin/main contains only JSON and TypeScript files; it changes no cmux-owned Swift code or Swift concurrency patterns.
Cmux Swift @Concurrent ✅ Passed The PR diff contains only JSON, TypeScript, and TSX files. It contains no Swift changes, so the Swift @concurrent check does not apply.
Cmux Swift Package Boundaries ✅ Passed The complete PR range contains no .swift files; all changed paths are web TypeScript, JSON, and tests, so Swift package boundaries are not applicable.
Cmux Swiftpm Lockfiles ✅ Passed The PR diff contains only web application, service, test, and privacy-policy files; it changes no Package.swift, Package.resolved, .gitignore, workflow, or Xcode project files.
Cmux Swift Logging ✅ Passed The aggregate PR diff contains only JSON, TypeScript, and TSX files; it changes no Swift files and adds no Swift logging constructs.
Cmux User-Facing Error Privacy ✅ Passed The production diff adds no user-facing error or recovery text; the identity API returns identity data, while Stripe IDs stay in analytics payloads and analytics failures are swallowed.
Cmux Full Internationalization ✅ Passed Privacy-policy text uses the locale-specific content loader, and all 20 routing locales have translated edits; analytics/API changes add no user-facing copy or missing message keys.
Cmux Swiftui State Layout ✅ Passed The diff contains 20 JSON, 8 TypeScript, and 1 TSX file, with no Swift paths or added SwiftUI state/layout constructs; the check is not applicable.
Cmux Architecture Rethink ✅ Passed The PR range from origin/main contains only web TypeScript, JSON, and test files, with zero changed .swift paths; the Swift architectural-rethink rule is not applicable.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: the diff contains only JSON, TypeScript, and TSX files; it introduces no Swift window code or auxiliary-window shortcut changes.
Cmux Source Artifacts ✅ Passed All 43 changed paths are source, tests, workflow, localization catalogs, or intentional deletions; no artifact-like paths, binary blobs, scratch directories, or generated output were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed The PR diff from merge base contains only JSON and TypeScript changes; it adds no Swift files under a production Sources path, so this check is not applicable.
Cmux No Ambient Global State ✅ Passed The full PR diff against origin/main contains no .swift files; all changes are web TypeScript, tests, and JSON, so the Swift ambient-global-state check is not applicable.
Title check ✅ Passed The title clearly summarizes the main change: connecting Hexclave and Stripe billing analytics to PostHog.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-stack-stripe-posthog-identity

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/app/`[locale]/(legal)/privacy-policy/content/en.json:
- Line 67: Update the PostHog disclosure entry at line 67 in
web/app/[locale]/(legal)/privacy-policy/content/en.json to explicitly list
billing plan, subscription status, amount/currency, and Stripe identifiers,
alongside the existing checkout, subscription, invoice, and account-identity
data. Add equivalent localized wording at line 67 in ar.json, bs.json, da.json,
de.json, es.json, fr.json, and it.json, preserving each translation’s existing
content while making all specified billing categories explicit.

In `@web/app/`[locale]/posthog.tsx:
- Around line 9-31: The StackIdentityTracker only synchronizes identity on
mount, so sign-out leaves the previous Stack user ID in localStorage. Update
StackIdentityTracker to subscribe to the client authentication sign-out event
and re-fetch /api/analytics/identity or reset via syncStackAnalyticsIdentity
with an anonymous identity when sign-out occurs; preserve the existing abort and
cleanup behavior, and cover the transition from an authenticated user ID to
anonymous.

In `@web/app/api/analytics/identity/route.ts`:
- Around line 32-35: Update the identity route around dependencies.getUser so
lookup rejections are caught and treated as an anonymous identity by returning
identityResponse(null) rather than propagating a 500. Preserve the existing
handling for authenticated and anonymous users, and add coverage for a rejecting
getUser dependency.

In `@web/app/api/stripe/webhook/route.ts`:
- Around line 166-173: In the Stripe webhook handler, change each final
captureStripeBillingEvent call at web/app/api/stripe/webhook/route.ts lines
166-173, 183-188, and 202-207 to run after the response path rather than being
awaited inline. Keep analytics errors isolated from the webhook result so
PostHog delays or failures cannot delay or fail the Stripe response, while
preserving the existing event and analyticsSubject arguments.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 41a0f2c9-4bfb-4667-894b-313af8f41763

📥 Commits

Reviewing files that changed from the base of the PR and between 4569dbb and bc5f99b.

📒 Files selected for processing (29)
  • web/app/[locale]/(legal)/privacy-policy/content/ar.json
  • web/app/[locale]/(legal)/privacy-policy/content/bs.json
  • web/app/[locale]/(legal)/privacy-policy/content/da.json
  • web/app/[locale]/(legal)/privacy-policy/content/de.json
  • web/app/[locale]/(legal)/privacy-policy/content/en.json
  • web/app/[locale]/(legal)/privacy-policy/content/es.json
  • web/app/[locale]/(legal)/privacy-policy/content/fr.json
  • web/app/[locale]/(legal)/privacy-policy/content/it.json
  • web/app/[locale]/(legal)/privacy-policy/content/ja.json
  • web/app/[locale]/(legal)/privacy-policy/content/km.json
  • web/app/[locale]/(legal)/privacy-policy/content/ko.json
  • web/app/[locale]/(legal)/privacy-policy/content/no.json
  • web/app/[locale]/(legal)/privacy-policy/content/pl.json
  • web/app/[locale]/(legal)/privacy-policy/content/pt-BR.json
  • web/app/[locale]/(legal)/privacy-policy/content/ru.json
  • web/app/[locale]/(legal)/privacy-policy/content/th.json
  • web/app/[locale]/(legal)/privacy-policy/content/tr.json
  • web/app/[locale]/(legal)/privacy-policy/content/uk.json
  • web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json
  • web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json
  • web/app/[locale]/posthog.tsx
  • web/app/api/analytics/identity/route.ts
  • web/app/api/stripe/webhook/route.ts
  • web/services/analytics/stackIdentity.ts
  • web/services/analytics/stripeBilling.ts
  • web/tests/analytics-identity-route.test.ts
  • web/tests/stack-analytics-identity.test.ts
  • web/tests/stripe-billing-analytics.test.ts
  • web/tests/stripe-webhook-route.test.ts

Comment thread web/app/[locale]/posthog.tsx Resolved
Comment thread web/app/api/analytics/identity/route.ts Outdated
Comment on lines +32 to +35
const user = await dependencies.getUser(request);
// Stack anonymous checkout users must not replace PostHog's browser-level
// anonymous identity. They become canonical only after account conversion.
return identityResponse(user && !user.isAnonymous ? { id: user.id } : null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle Stack lookup failures as anonymous identity.

Line 32 rejects the route when dependencies.getUser() fails. This returns a 500 response for an analytics-only lookup.

Catch this failure and return { user: null }. Add a test where getUser rejects.

Proposed fix
-    const user = await dependencies.getUser(request);
+    let user: { readonly id: string; readonly isAnonymous: boolean } | null;
+    try {
+      user = await dependencies.getUser(request);
+    } catch {
+      return identityResponse(null);
+    }

Based on PR objectives, analytics failures must be non-authoritative.

📝 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.

Suggested change
const user = await dependencies.getUser(request);
// Stack anonymous checkout users must not replace PostHog's browser-level
// anonymous identity. They become canonical only after account conversion.
return identityResponse(user && !user.isAnonymous ? { id: user.id } : null);
let user: { readonly id: string; readonly isAnonymous: boolean } | null;
try {
user = await dependencies.getUser(request);
} catch {
return identityResponse(null);
}
// Stack anonymous checkout users must not replace PostHog's browser-level
// anonymous identity. They become canonical only after account conversion.
return identityResponse(user && !user.isAnonymous ? { id: user.id } : null);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/app/api/analytics/identity/route.ts` around lines 32 - 35, Update the
identity route around dependencies.getUser so lookup rejections are caught and
treated as an anonymous identity by returning identityResponse(null) rather than
propagating a 500. Preserve the existing handling for authenticated and
anonymous users, and add coverage for a rejecting getUser dependency.

Comment thread web/app/api/stripe/webhook/route.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/app/`[locale]/(legal)/privacy-policy/content/ar.json:
- Line 67: Update the privacy-policy retention section corresponding to the
PostHog disclosure in
web/app/[locale]/(legal)/privacy-policy/content/ar.json:67-67, bs.json:67-67,
da.json:67-67, de.json:67-67, ru.json:67-67, th.json:67-67, tr.json:67-67,
uk.json:67-67, zh-CN.json:67-67, and zh-TW.json:67-67. Add consistent
retention/deletion wording covering web analytics, post-sign-in account-linked
analytics, billing lifecycle data, and Stripe identifiers, or reference the
applicable external policy, using the same wording across all locale files.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bde5abb2-006b-489e-875d-d36d8c763637

📥 Commits

Reviewing files that changed from the base of the PR and between bc5f99b and b8e5c7f.

📒 Files selected for processing (23)
  • web/app/[locale]/(legal)/privacy-policy/content/ar.json
  • web/app/[locale]/(legal)/privacy-policy/content/bs.json
  • web/app/[locale]/(legal)/privacy-policy/content/da.json
  • web/app/[locale]/(legal)/privacy-policy/content/de.json
  • web/app/[locale]/(legal)/privacy-policy/content/en.json
  • web/app/[locale]/(legal)/privacy-policy/content/es.json
  • web/app/[locale]/(legal)/privacy-policy/content/fr.json
  • web/app/[locale]/(legal)/privacy-policy/content/it.json
  • web/app/[locale]/(legal)/privacy-policy/content/ja.json
  • web/app/[locale]/(legal)/privacy-policy/content/km.json
  • web/app/[locale]/(legal)/privacy-policy/content/ko.json
  • web/app/[locale]/(legal)/privacy-policy/content/no.json
  • web/app/[locale]/(legal)/privacy-policy/content/pl.json
  • web/app/[locale]/(legal)/privacy-policy/content/pt-BR.json
  • web/app/[locale]/(legal)/privacy-policy/content/ru.json
  • web/app/[locale]/(legal)/privacy-policy/content/th.json
  • web/app/[locale]/(legal)/privacy-policy/content/tr.json
  • web/app/[locale]/(legal)/privacy-policy/content/uk.json
  • web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json
  • web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json
  • web/app/[locale]/posthog.tsx
  • web/app/api/stripe/webhook/route.ts
  • web/tests/stripe-webhook-route.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/app/[locale]/posthog.tsx (1)

35-53: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Commit only successful, current identity lookups before capturing pageviews.

When /api/analytics/identity fails or returns 401/404, capturePageview() still runs with the previous PostHog identity. A sign-out or account change can therefore attribute the pageview to the old Stack user. Capture only after the current request resolves an explicit identity, including an explicit anonymous/null response, and reject newer navigation requests before syncing identity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/app/`[locale]/posthog.tsx around lines 35 - 53, Update the promise flow
around the identity lookup and capturePageview so pageviews occur only after a
successful current response with an explicit StackAnalyticsIdentity or anonymous
null identity. Do not call capturePageview for fetch errors, non-OK responses
such as 401/404, malformed or incomplete payloads, or an aborted/stale request;
ensure newer navigation requests are rejected before syncStackAnalyticsIdentity
and retain the existing identity otherwise.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/app/`[locale]/posthog.tsx:
- Around line 35-53: Update the promise flow around the identity lookup and
capturePageview so pageviews occur only after a successful current response with
an explicit StackAnalyticsIdentity or anonymous null identity. Do not call
capturePageview for fetch errors, non-OK responses such as 401/404, malformed or
incomplete payloads, or an aborted/stale request; ensure newer navigation
requests are rejected before syncStackAnalyticsIdentity and retain the existing
identity otherwise.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6dcabecc-a860-4552-98be-64c3d69c8ea9

📥 Commits

Reviewing files that changed from the base of the PR and between b8e5c7f and b188c17.

📒 Files selected for processing (5)
  • web/app/[locale]/posthog.tsx
  • web/app/api/analytics/identity/route.ts
  • web/services/analytics/stackIdentity.ts
  • web/tests/analytics-identity-route.test.ts
  • web/tests/stack-analytics-identity.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/app/`[locale]/(legal)/privacy-policy/content/de.json:
- Line 124: Align the retention and deletion wording in the matching locale
entries: update de.json, zh-CN.json, and zh-TW.json at line 124 to use
account-wide settings rather than mobile-account settings; update ru.json and
uk.json at line 124 likewise and remove the duplicated analytics wording next to
“account”.

In `@web/app/`[locale]/(legal)/privacy-policy/content/tr.json:
- Line 124: In the Turkish privacy-policy text, update the locative reference
from “PostHog'teki” to “PostHog'daki” while preserving the surrounding retention
statement unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6740a1e6-ee47-4980-bc27-719c776a51c0

📥 Commits

Reviewing files that changed from the base of the PR and between b188c17 and 823e3ad.

📒 Files selected for processing (20)
  • web/app/[locale]/(legal)/privacy-policy/content/ar.json
  • web/app/[locale]/(legal)/privacy-policy/content/bs.json
  • web/app/[locale]/(legal)/privacy-policy/content/da.json
  • web/app/[locale]/(legal)/privacy-policy/content/de.json
  • web/app/[locale]/(legal)/privacy-policy/content/en.json
  • web/app/[locale]/(legal)/privacy-policy/content/es.json
  • web/app/[locale]/(legal)/privacy-policy/content/fr.json
  • web/app/[locale]/(legal)/privacy-policy/content/it.json
  • web/app/[locale]/(legal)/privacy-policy/content/ja.json
  • web/app/[locale]/(legal)/privacy-policy/content/km.json
  • web/app/[locale]/(legal)/privacy-policy/content/ko.json
  • web/app/[locale]/(legal)/privacy-policy/content/no.json
  • web/app/[locale]/(legal)/privacy-policy/content/pl.json
  • web/app/[locale]/(legal)/privacy-policy/content/pt-BR.json
  • web/app/[locale]/(legal)/privacy-policy/content/ru.json
  • web/app/[locale]/(legal)/privacy-policy/content/th.json
  • web/app/[locale]/(legal)/privacy-policy/content/tr.json
  • web/app/[locale]/(legal)/privacy-policy/content/uk.json
  • web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json
  • web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json

"heading": "IX. Datenaufbewahrung",
"paragraphs": [
"Absturzberichte und Diagnosen werden nur so lange aufbewahrt, wie es zur Diagnose und Behebung von Problemen erforderlich ist. Identifikatoren und Authentifizierungsdaten für mobile Konten werden aufbewahrt, solange Ihr Konto aktiv ist, und nach Abschluss der Kontolöschung gelöscht oder anonymisiert, es sei denn, die Aufbewahrung ist aus Sicherheits-, Rechts-, Abrechnungs- oder Betrugspräventionsgründen erforderlich. Geräte- und Kopplungsmetadaten bleiben erhalten, bis Sie die Kopplung aufheben, sich abmelden und lokale Daten löschen, Ihr Konto löschen oder veraltete Kopplungsdaten bereinigt werden. Apple-Push-Benachrichtigungsdienst-Tokens werden nur aufbewahrt, solange Benachrichtigungen aktiviert sind, und werden entfernt, wenn Sie Benachrichtigungen deaktivieren, sich abmelden, Ihr Konto löschen oder Apple das Token als ungültig meldet. Mobile Produktanalysen in PostHog werden bis zu 24 Monate lang aufbewahrt, es sei denn, Sie beantragen eine frühere Löschung. Mobile Kontoeinstellungen löschen oder anonymisieren cmux-eigene Konto-, Geräte-, Kopplungs-, Benachrichtigungs-, Abrechnungs- und Cloud-Daten, löschen die mit dem Konto verknüpfte PostHog-Person und fordern die Löschung ihrer mobilen Analyseereignisse und Aufzeichnungen an. Einige Löscharbeiten für Anbieter werden möglicherweise asynchron abgeschlossen. Fordern Sie die Löschung in den Einstellungen des mobilen Kontos an oder wenden Sie sich an [founders@manaflow.com](mailto:founders@manaflow.com)."
"Absturzberichte und Diagnosen werden nur so lange aufbewahrt, wie es zur Diagnose und Behebung von Problemen erforderlich ist. Identifikatoren und Authentifizierungsdaten für mobile Konten werden aufbewahrt, solange Ihr Konto aktiv ist, und nach Abschluss der Kontolöschung gelöscht oder anonymisiert, es sei denn, Sicherheits-, Rechts-, Abrechnungs- oder Betrugspräventionspflichten erfordern eine Aufbewahrung. Geräte- und Kopplungsmetadaten bleiben bis zur Entkopplung, Abmeldung und Löschung lokaler Daten, Kontolöschung oder Bereinigung veralteter Daten erhalten. Apple-Push-Tokens werden nur bei aktivierten Benachrichtigungen gespeichert. Website- und mobile Produktanalysen, kontoverknüpfte Analysen, Abrechnungsereignisse und Stripe-Kennungen in PostHog werden bis zu 24 Monate aufbewahrt, sofern Sie keine frühere Löschung beantragen. Mobile Kontoeinstellungen löschen oder anonymisieren cmux-eigene Daten, löschen die kontoverknüpfte PostHog-Person und beantragen die Löschung ihrer Website- und mobilen Analyseereignisse und Aufzeichnungen. Einige Abrechnungsdaten und Stripe-Kennungen können aus Sicherheits-, Rechts-, Steuer-, Abrechnungs- oder Betrugspräventionsgründen aufbewahrt werden. Anbieter-Löschungen können asynchron erfolgen. Beantragen Sie die Löschung in den mobilen Kontoeinstellungen oder über [founders@manaflow.com](mailto:founders@manaflow.com)."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -i -C 3 \
  'delete.?account|account.?delet|request.?delet|mobile.?account|account.?settings|PostHog|posthog' \
  web/app web/services web/tests || true

Repository: manaflow-ai/cmux

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== privacy policy JSON files around retention/deletion lines =="
for f in \
  'web/app/[locale]/(legal)/privacy-policy/content/de.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/ru.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/uk.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/en.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/tr.json'
do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '60,75p;118,130p' "$f" | cat -n
  fi
done

echo
echo "== privacy policy source files in app and services =="
git ls-files 'web/app/**' 'web/services/**' | rg 'privacy|account|posthog|billing|stripe' | sed -n '1,200p'

echo
echo "== focused searches for account deletion terms =="
rg -n -i --glob 'web/**/*' \
  'delete.?account|account.?delet|request.?delet|mobile.?account|account.?settings|PostHog|posthog|billing.?account|Stripe|stripe' \
  web/app web/services web/routes web/tests 2>/dev/null | sed -n '1,280p'

Repository: manaflow-ai/cmux

Length of output: 50372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, subprocess, collections
files = collections.OrderedDict([
    ("web/app/[locale]/(legal)/privacy-policy/content/ar.json", "ar"),
    ("web/app/[locale]/(legal)/privacy-policy/content/bs.json", "bs"),
    ("web/app/[locale]/(legal)/privacy-policy/content/da.json", "da"),
    ("web/app/[locale]/(legal)/privacy-policy/content/de.json", "de"),
    ("web/app/[locale]/(legal)/privacy-policy/content/en.json", "en"),
    ("web/app/[locale]/(legal)/privacy-policy/content/es.json", "es"),
    ("web/app/[locale]/(legal)/privacy-policy/content/fr.json", "fr"),
    ("web/app/[locale]/(legal)/privacy-policy/content/it.json", "it"),
    ("web/app/[locale]/(legal)/privacy-policy/content/ja.json", "ja"),
    ("web/app/[locale]/(legal)/privacy-policy/content/km.json", "km"),
    ("web/app/[locale]/(legal)/privacy-policy/content/ko.json", "ko"),
    ("web/app/[locale]/(legal)/privacy-policy/content/no.json", "no"),
    ("web/app/[locale]/(legal)/privacy-policy/content/pl.json", "pl"),
    ("web/app/[locale]/(legal)/privacy-policy/content/pt-BR.json", "pt-BR"),
    ("web/app/[locale]/(legal)/privacy-policy/content/ru.json", "ru"),
    ("web/app/[locale]/(legal)/privacy-policy/content/th.json", "th"),
    ("web/app/[locale]/(legal)/privacy-policy/content/tr.json", "tr"),
    ("web/app/[locale]/(legal)/privacy-policy/content/uk.json", "uk"),
    ("web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json", "zh-CN"),
    ("web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json", "zh-TW"),
])
terms = {
    "mobile accounts": ["account identifiers", "Authentication records"],
    "mobile account settings": ["settings"],
    "account settings": ["account settings"],
}
for path, locale in files.items():
    try:
        data=json.load(open(path, encoding="utf-8"))
    except Exception as e:
        print(f"ERROR {path}: {e}")
        continue
    # Find IX Data Retention paragraph and first "afterBullets" question paragraph candidates.
    retention = None
    for item in data.get("sections", []):
        heading = item.get("heading","")
        if heading and ("Data Retention" in heading or "Sammensæt" in heading or " хранение" in heading.lower() or "保留" in heading):
            retention = item
            break
    print(f"-- {path} --")
    if retention and "paragraphs" in retention:
        print("found retention section:", retention["heading"])
        text = " ".join(retention["paragraphs"])
        issues = []
        for term, variants in terms.items():
            if term in text:
                for v in variants:
                    if v in text:
                        issues.append(f"{v} in mobile-account context")
        if not issues and term not in text:
            issues.append("missing mobile account phrasing")
        print("issues:", "; ".join(issues) if issues else "none from quick marker scan")
        print("first mobile/account wording:",
              " ".join([p for p in retention["paragraphs"] if ("Account" in p or "account" in p or "settings" in p or "mobile" in p or "設定" in p or "設定" in p)]))
    else:
        print("NO_RETE NTION_FOUND")
PY

echo
echo "== line 124 retention terms by locale =="
python3 - <<'PY'
import json, pathlib, re
terms = [
    "Account identifiers and authentication records",
    "Mobile account identifiers",
    "account deletion finishes",
    "account settings",
    "Mobile account settings",
    "account-linked analytics",
    "Website and mobile product analytics",
    "PostHog",
]
for rel in pathlib.Path("web/app/[locale]/(legal)/privacy-policy/content").glob("*.json"):
    data=json.loads(rel.read_text(encoding="utf-8"))
    # Use key for compact output
    print("\n---", rel.relative_to("web/app/[locale]/(legal)/privacy-policy/content"))
    print("--- content IX afterBullets section index")
    print(data[100])
PY

Repository: manaflow-ai/cmux

Length of output: 4167


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== JSON structure for one retention file =="
python3 - <<'PY'
import json
from pathlib import Path
p=Path('web/app/[locale]/(legal)/privacy-policy/content/en.json')
data=json.loads(p.read_text())
print("top_level_keys:", list(data.keys())[:20])
print("data_type:", type(data).__name__)
if isinstance(data, dict):
    print("IX section key candidates:", [k for k in data if isinstance(data[k], dict) and data[k].get("heading") == "IX. Data Retention"])
if isinstance(data, list):
    for i, item in enumerate(data):
        if isinstance(item, dict):
            h=item.get("heading","")
            if "Data Retention" in h or "Sammensæt" in h or " хранение" in h.lower() or "保留" in h:
                print("index", i, "heading", h)
                print(json.dumps(item[:3], ensure_ascii=False, indent=2)[:500])
                print(json.dumps(item[-2:], ensure_ascii=False, indent=2)[:1000])
                break
PY

echo
echo "== retention data key for listed files =="
python3 - <<'PY'
import json, subprocess
for path in [
    'web/app/[locale]/(legal)/privacy-policy/content/de.json',
    'web/app/[locale]/(legal)/privacy-policy/content/ru.json',
    'web/app/[locale]/(legal)/privacy-policy/content/uk.json',
    'web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json',
    'web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json',
    'web/app/[locale]/(legal)/privacy-policy/content/en.json',
    'web/app/[locale]/(legal)/privacy-policy/content/tr.json',
]:
    data=json.load(open(path, encoding="utf-8"))
    ret = None
    if isinstance(data, dict):
        for k,v in data.items():
            if isinstance(v, dict) and v.get("heading") and "IX" in str(v.get("heading","")):
                ret=v["heading"]
    elif isinstance(data, list):
        for item in data:
            if isinstance(item, dict) and item.get("heading") and "IX" in str(item.get("heading","")):
                ret=item["heading"]
    print(path, "IX heading:", ret)
PY

echo
echo "== exact source snippets for data retention sections =="
for f in \
  'web/app/[locale]/(legal)/privacy-policy/content/de.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/ru.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/uk.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/en.json' \
  'web/app/[locale]/(legal)/privacy-policy/content/tr.json'
do
  echo "--- $f ---"
  python3 - <<'PY' "$f"
import json, sys
path=sys.argv[1]
data=json.load(open(path, encoding="utf-8"))
if isinstance(data, dict):
    collection=data
elif isinstance(data, list):
    collection=data
else:
    raise SystemExit("unknown structure")
for item in collection:
    heading=item.get("heading","")
    if heading and "IX" in str(heading):
        print("SECTION", repr(heading))
        print("paragraphs:")
        for part in item.get("paragraphs",[]):
            print(part)
        print("afterBullets:")
        for part in item.get("afterBullets",[]):
            print(part)
PY
done

Repository: manaflow-ai/cmux

Length of output: 1144


Align the account-wide retention and deletion wording across locale catalogs.

Line 67 discloses account-linked web and mobile analytics, so line 124 must not scope the deletion mechanism to mobile accounts.

  • de, zh-CN, and zh-TW still read “mobile account settings”; use account-wide wording.
  • ru and uk still mention mobile-account settings and should remove the duplicated analytics word next to “account”.
  • Update the matching locale entries so retention and deletion information does not differ by locale.
📍 Affects 5 files
  • web/app/[locale]/(legal)/privacy-policy/content/de.json#L124-L124 (this comment)
  • web/app/[locale]/(legal)/privacy-policy/content/ru.json#L124-L124
  • web/app/[locale]/(legal)/privacy-policy/content/uk.json#L124-L124
  • web/app/[locale]/(legal)/privacy-policy/content/zh-CN.json#L124-L124
  • web/app/[locale]/(legal)/privacy-policy/content/zh-TW.json#L124-L124
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/app/`[locale]/(legal)/privacy-policy/content/de.json at line 124, Align
the retention and deletion wording in the matching locale entries: update
de.json, zh-CN.json, and zh-TW.json at line 124 to use account-wide settings
rather than mobile-account settings; update ru.json and uk.json at line 124
likewise and remove the duplicated analytics wording next to “account”.

Source: Coding guidelines

"heading": "IX. Veri Saklama",
"paragraphs": [
"Kilitlenme raporları ve tanılamalar yalnızca sorunları tanılamak ve düzeltmek için gerekli olduğu sürece saklanır. Mobil hesap tanımlayıcıları ve kimlik doğrulama kayıtları, hesabınız etkinken tutulur, güvenlik, yasal, faturalandırma veya dolandırıcılığı önleme görevlerinin saklamayı gerektirdiği durumlar hariç, hesap silme işlemi tamamlandığında silinir veya anonimleştirilir. Cihaz ve eşleştirme meta verileri, siz eşleştirmeyi kaldırıncaya, oturumunuzu kapatıp yerel verileri silinceye, hesabınızı silinceye veya eski eşleştirme verileri budanıncaya kadar tutulur. Apple Anında Bildirim hizmeti belirteçleri yalnızca bildirimler etkinleştirildiğinde tutulur ve bildirimleri devre dışı bıraktığınızda, oturumu kapattığınızda, hesabınızı sildiğinizde veya Apple belirtecin geçersiz olduğunu bildirdiğinizde kaldırılır. PostHog'teki mobil ürün analitiği, daha önce silinmesini talep etmediğiniz sürece 24 aya kadar saklanır. Mobil hesap ayarları, cmux'e ait hesabı, cihazı, eşleştirmeyi, bildirimi, faturalandırmayı ve bulut verilerini siler veya anonimleştirir, hesaba bağlı PostHog kişisini siler ve mobil analiz etkinliklerinin ve kayıtlarının silinmesini talep eder. Bazı sağlayıcı silme çalışmaları eşzamansız olarak tamamlanabilir. Mobil hesap ayarlarından veya [founders@manaflow.com](mailto:founders@manaflow.com) ile iletişime geçerek silme işlemini talep edin."
"Kilitlenme raporları ve tanılamalar yalnızca gerektiği sürece saklanır. Hesap tanımlayıcıları ve kimlik doğrulama verileri hesap etkinken tutulur, ardından güvenlik, yasal, vergi, faturalandırma veya dolandırıcılığı önleme yükümlülükleri dışında silinir ya da anonimleştirilir. Cihaz ve eşleştirme verileri bağlantı kesilene veya silinene, Apple belirteçleri ise yalnızca bildirimler etkin olduğu sürece tutulur. PostHog'teki web ve mobil analizler, hesaba bağlı analizler, faturalandırma yaşam döngüsü etkinlikleri ve Stripe tanımlayıcıları, daha erken silme istemediğiniz sürece 24 aya kadar saklanır. Hesap ayarları cmux verilerini siler veya anonimleştirir, bağlı PostHog kişisini siler ve web ve mobil analiz etkinlikleri ile kayıtlarının silinmesini ister. Bazı faturalandırma kayıtları ve Stripe tanımlayıcıları güvenlik, yasal, vergi, faturalandırma veya dolandırıcılığı önleme yükümlülükleri nedeniyle saklanabilir. Sağlayıcı silmeleri eşzamansız tamamlanabilir. Ayarlardan veya [founders@manaflow.com](mailto:founders@manaflow.com) üzerinden silme isteyin."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Turkish suffix vowel harmony locative PostHog'daki PostHog'teki grammar

💡 Result:

To determine the correct locative suffix for "PostHog", you must apply Turkish vowel harmony and consonant harmony rules. The locative suffix in Turkish is either -da, -de, -ta, or -te [1][2][3]. The correct form is chosen as follows: 1. Vowel Harmony: The last vowel in the word "PostHog" is "o" (a back vowel). Therefore, the suffix must contain a back vowel ("a"). This narrows the choice to -da or -ta [1][3]. 2. Consonant Harmony: If the word ends in a voiceless consonant (f, s, t, k, ç, ş, h, p), the initial consonant of the suffix changes from 'd' to 't' [1][2][3]. The word "PostHog" ends in the letter 'g', which is a voiced consonant. Therefore, the suffix remains -da [1][4]. Following these rules, the correct form is PostHog'da. Note on the -ki suffix: If you are using the "-ki" suffix (the relative suffix used to turn a locative phrase into an adjective, meaning "the one at/in/on"), it is attached after the locative suffix [5]. Because "ki" is invariant regarding vowel harmony, it does not change its form [5]. Therefore, the correct form for "the one in/at PostHog" is PostHog'daki [5]. The form PostHog'teki would be incorrect because "e" is a front vowel and does not harmonize with the back vowel "o" in PostHog [6][3].

Citations:


Correct the Turkish locative form.

Use PostHog'daki instead of PostHog'teki, since vowel harmony requires the back vowel form.

Proposed correction
-PostHog'teki
+PostHog'daki
📝 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.

Suggested change
"Kilitlenme raporları ve tanılamalar yalnızca gerektiği sürece saklanır. Hesap tanımlayıcıları ve kimlik doğrulama verileri hesap etkinken tutulur, ardından güvenlik, yasal, vergi, faturalandırma veya dolandırıcılığı önleme yükümlülükleri dışında silinir ya da anonimleştirilir. Cihaz ve eşleştirme verileri bağlantı kesilene veya silinene, Apple belirteçleri ise yalnızca bildirimler etkin olduğu sürece tutulur. PostHog'teki web ve mobil analizler, hesaba bağlı analizler, faturalandırma yaşam döngüsü etkinlikleri ve Stripe tanımlayıcıları, daha erken silme istemediğiniz sürece 24 aya kadar saklanır. Hesap ayarları cmux verilerini siler veya anonimleştirir, bağlı PostHog kişisini siler ve web ve mobil analiz etkinlikleri ile kayıtlarının silinmesini ister. Bazı faturalandırma kayıtları ve Stripe tanımlayıcıları güvenlik, yasal, vergi, faturalandırma veya dolandırıcılığı önleme yükümlülükleri nedeniyle saklanabilir. Sağlayıcı silmeleri eşzamansız tamamlanabilir. Ayarlardan veya [founders@manaflow.com](mailto:founders@manaflow.com) üzerinden silme isteyin."
"Kilitlenme raporları ve tanılamalar yalnızca gerektiği sürece saklanır. Hesap tanımlayıcıları ve kimlik doğrulama verileri hesap etkinken tutulur, ardından güvenlik, yasal, vergi, faturalandırma veya dolandırıcılığı önleme yükümlülükleri dışında silinir ya da anonimleştirilir. Cihaz ve eşleştirme verileri bağlantı kesilene veya silinene, Apple belirteçleri ise yalnızca bildirimler etkin olduğu sürece tutulur. PostHog'daki web ve mobil analizler, hesaba bağlı analizler, faturalandırma yaşam döngüsü etkinlikleri ve Stripe tanımlayıcıları, daha erken silme istemediğiniz sürece 24 aya kadar saklanır. Hesap ayarları cmux verilerini siler veya anonimleştirir, bağlı PostHog kişisini siler ve web ve mobil analiz etkinlikleri ile kayıtlarının silinmesini ister. Bazı faturalandırma kayıtları ve Stripe tanımlayıcıları güvenlik, yasal, vergi, faturalandırma veya dolandırıcılığı önleme yükümlülükleri nedeniyle saklanabilir. Sağlayıcı silmeleri eşzamansız tamamlanabilir. Ayarlardan veya [founders@manaflow.com](mailto:founders@manaflow.com) üzerinden silme isteyin."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/app/`[locale]/(legal)/privacy-policy/content/tr.json at line 124, In the
Turkish privacy-policy text, update the locative reference from “PostHog'teki”
to “PostHog'daki” while preserving the surrounding retention statement
unchanged.

Source: Coding guidelines

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/app/`[locale]/posthog.tsx:
- Around line 39-66: Update the identity-fetch callback in the posthog
initialization flow to return immediately when controller.signal.aborted, both
before handling a non-OK response and after await response.json() before any
identity mutation. Preserve the existing validation and synchronization behavior
for active requests, and add a controlled-promise regression test that resolves
two identity requests out of order to verify the older response cannot overwrite
the newer identity.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4dece2ff-8cc1-4d3e-9747-c94b3418386e

📥 Commits

Reviewing files that changed from the base of the PR and between 823e3ad and bd8219f.

📒 Files selected for processing (5)
  • web/app/[locale]/posthog.tsx
  • web/app/api/stripe/webhook/route.ts
  • web/services/analytics/stackIdentity.ts
  • web/tests/stack-analytics-identity.test.ts
  • web/tests/stripe-webhook-route.test.ts

Comment thread web/app/[locale]/posthog.tsx Resolved
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen
lawrencecchen merged commit f5cd283 into main Aug 6, 2026
6 checks passed
@lawrencecchen
lawrencecchen deleted the task-stack-stripe-posthog-identity branch August 6, 2026 12:33
vishalkrishnads pushed a commit to vishalkrishnads/cmux that referenced this pull request Nov 24, 2026
… git-config step, and pass over an unreadable main verdict (manaflow-ai#53486)

Every leo-workspace PR's land stopped red_not_excused on 2026-11-24 for three reasons, none of them the PR's:
- tools/ws-check discount_base_reds (lw#9404) counts only a run's own failed units in its status,
  "N of M steps failed: UNIT (+K base red discounted, main SHA8)" (or, since lw#9754, the marker before the unit),
  while WS_CHECK_RESULT lists every failed step: refused "does not match run's WS_CHECK_RESULT" (lw#9704, manaflow-ai#9760,
  manaflow-ai#9702, manaflow-ai#9753). ws_check_described now checks the count, K and main against the run's own base-pass lines.
- ws_check_run.py's "global git config changed by a step" has no step line, only "ws-check: a step changed the
  global git config ...": refused "has no 'ws-check step FAILED: ...' line" (lw#9703). It is read from that line.
- main 106d10145c's run kept only the last 200 lines of a red suite (16 of 17 FAIL lines), and every head was refused
  "its failing tests cannot be listed" on main's run. An unreadable base verdict in the compared window is now passed
  over for the next one (the merge-base read stays strict); with none left the refusal names it.


Agent-Session: https://cmux.com/deeplink/agent?id=aid-974d4bf42986393391ee&model=claude-opus-5-5

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant