Repository navigation
fix(telemetry): keep platform axes and desktop entry props across logout reset - #13503
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesPostHog attribution
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant PostHogSDK
participant PostHogTelemetryProvider
PostHogSDK->>PostHogTelemetryProvider: pass captured event to before_send callback chain
PostHogTelemetryProvider-->>PostHogSDK: return stamped and filtered event
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The described attribution and logout behavior is covered by the updated implementation and tests; no actionable merge blocker is established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Logout still resets user identity and preserves the existing data filter. However, an older tab can restore a Desktop device identifier that a newer entry replaced or removed. The impact is limited to telemetry attribution and potential cross-account correlation; real multi-tab behavior has not been verified end to end. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 2241 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 9.35 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 4.43 kB (baseline 4.43 kB) • ⚪ 0 BMain entry bundles and manifests Status: 1 unchanged Graph Workspace — 2.14 MB (baseline 2.14 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration Status: 3 unchanged Views & Navigation — 154 kB (baseline 154 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces Status: 19 unchanged Panels & Settings — 671 kB (baseline 671 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens Status: 30 unchanged User & Accounts — 54.4 kB (baseline 54.4 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 15 unchanged Editors & Dialogs — 325 kB (baseline 325 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors Status: 13 unchanged UI Components — 201 kB (baseline 201 kB) • ⚪ 0 BReusable component library chunks Status: 24 unchanged Data & Services — 3.07 MB (baseline 3.07 MB) • ⚪ 0 BStores, services, APIs, and repositories Status: 22 unchanged Utilities & Hooks — 812 kB (baseline 812 kB) • ⚪ 0 BHelpers, composables, and utility bundles Status: 50 unchanged Vendor & Third-Party — 14.2 MB (baseline 14.2 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 18.7 MB (baseline 18.7 MB) • ⚪ 0 BBundles that do not match a named category Status: 347 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-10-08T08:48:30.854Z",
"gitSha": "8222a31394578e9e9d549667d9e8447e7f3b56d8",
"branch": "bl/recursing-cerf-0ad85e",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2008.7460000000306,
"styleRecalcs": 10,
"styleRecalcDurationMs": 3.231000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 438.974,
"heapDeltaBytes": 12811684,
"heapUsedBytes": 84136824,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.068999999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2040.8049999999776,
"styleRecalcs": 11,
"styleRecalcDurationMs": 4.023000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 500.4920000000001,
"heapDeltaBytes": -49278312,
"heapUsedBytes": 61235960,
"domNodes": -212,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 8.826,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66585365853659,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1710.568999999964,
"styleRecalcs": 73,
"styleRecalcDurationMs": 14.131000000000002,
"layouts": 12,
"layoutDurationMs": 4.630999999999999,
"taskDurationMs": 808.5440000000001,
"heapDeltaBytes": 8080688,
"heapUsedBytes": 78760112,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 153.99099999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666990291262135,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1728.482999999983,
"styleRecalcs": 74,
"styleRecalcDurationMs": 16.063000000000002,
"layouts": 12,
"layoutDurationMs": 4.374,
"taskDurationMs": 729.8639999999999,
"heapDeltaBytes": -26985820,
"heapUsedBytes": 82414380,
"domNodes": -212,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 150.20100000000002,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665384615384614,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1739.6080000000325,
"styleRecalcs": 19,
"styleRecalcDurationMs": 6.159000000000002,
"layouts": 3,
"layoutDurationMs": 0.75,
"taskDurationMs": 349.92199999999997,
"heapDeltaBytes": 12955552,
"heapUsedBytes": 82469748,
"domNodes": 45,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 9.994999999999997,
"eventListeners": 39,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666346153846156,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1703.9129999999432,
"styleRecalcs": 19,
"styleRecalcDurationMs": 5.729,
"layouts": 3,
"layoutDurationMs": 0.7380000000000002,
"taskDurationMs": 345.89300000000003,
"heapDeltaBytes": 13047384,
"heapUsedBytes": 84244208,
"domNodes": 45,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.848999999999997,
"eventListeners": 39,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66568627450981,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 673.7169999999537,
"styleRecalcs": 15,
"styleRecalcDurationMs": 4.466999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 513.687,
"heapDeltaBytes": -38359796,
"heapUsedBytes": 71936552,
"domNodes": -212,
"jsHeapTotalBytes": 2621440,
"scriptDurationMs": 168.963,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667499999999997,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 639.7780000000921,
"styleRecalcs": 13,
"styleRecalcDurationMs": 3.0509999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 475.715,
"heapDeltaBytes": -35952408,
"heapUsedBytes": 74658068,
"domNodes": -212,
"jsHeapTotalBytes": -3145728,
"scriptDurationMs": 170.97099999999998,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667567567567588,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1141.8270000000348,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 809.1239999999999,
"heapDeltaBytes": 14397420,
"heapUsedBytes": 94298268,
"domNodes": 0,
"jsHeapTotalBytes": 3833856,
"scriptDurationMs": 64.161,
"eventListeners": 0,
"totalBlockingTimeMs": 508,
"frameDurationMs": 33.332352941176474,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1146.519000000012,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 813.1919999999999,
"heapDeltaBytes": 14274800,
"heapUsedBytes": 100312532,
"domNodes": 0,
"jsHeapTotalBytes": 4620288,
"scriptDurationMs": 65.42800000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 519,
"frameDurationMs": 33.8235294117647,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 844.4959999999924,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 474.45499999999987,
"heapDeltaBytes": 19868948,
"heapUsedBytes": 99278928,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 165.36999999999995,
"eventListeners": 0,
"totalBlockingTimeMs": 219,
"frameDurationMs": 25,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 863.4819999999763,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 487.0920000000001,
"heapDeltaBytes": 20567100,
"heapUsedBytes": 107720540,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 171.13300000000004,
"eventListeners": 0,
"totalBlockingTimeMs": 227,
"frameDurationMs": 25.488235294117658,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9939.520000000015,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9107.671,
"heapDeltaBytes": 13367584,
"heapUsedBytes": 96544240,
"domNodes": 0,
"jsHeapTotalBytes": -8126464,
"scriptDurationMs": 7784.450000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 1316,
"frameDurationMs": 33.44410774410774,
"p95FrameDurationMs": 66.69999999999891
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9989.978999999948,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9212.344,
"heapDeltaBytes": -8520820,
"heapUsedBytes": 75034752,
"domNodes": 0,
"jsHeapTotalBytes": -14942208,
"scriptDurationMs": 7589.579000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 801,
"frameDurationMs": 31.894249201277955,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9499.328000000049,
"styleRecalcs": 2,
"styleRecalcDurationMs": 0.37300000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8690.172999999999,
"heapDeltaBytes": 5210024,
"heapUsedBytes": 94109624,
"domNodes": -141,
"jsHeapTotalBytes": -12455936,
"scriptDurationMs": 7119.75,
"eventListeners": -73,
"totalBlockingTimeMs": 715,
"frameDurationMs": 32.53321917808219,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9135.122000000025,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8390.445,
"heapDeltaBytes": 3277632,
"heapUsedBytes": 86595996,
"domNodes": 0,
"jsHeapTotalBytes": -19922944,
"scriptDurationMs": 6843.999,
"eventListeners": 0,
"totalBlockingTimeMs": 541,
"frameDurationMs": 32.045614035087716,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "large-graph-idle",
"durationMs": 2042.4540000000206,
"styleRecalcs": 9,
"styleRecalcDurationMs": 3.0709999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 559.864,
"heapDeltaBytes": -18362924,
"heapUsedBytes": 87210524,
"domNodes": -308,
"jsHeapTotalBytes": -4329472,
"scriptDurationMs": 31.370000000000008,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66557377049181,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2041.3810000000012,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.973,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 550.287,
"heapDeltaBytes": -45812492,
"heapUsedBytes": 87880452,
"domNodes": -308,
"jsHeapTotalBytes": -3244032,
"scriptDurationMs": 30.732000000000003,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536584,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2231.666999999959,
"styleRecalcs": 68,
"styleRecalcDurationMs": 6.139,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1517.882,
"heapDeltaBytes": 23471732,
"heapUsedBytes": 88775196,
"domNodes": -308,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 774.497,
"eventListeners": -124,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665413533834588,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2166.052000000036,
"styleRecalcs": 68,
"styleRecalcDurationMs": 5.97,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1563.778,
"heapDeltaBytes": -45175140,
"heapUsedBytes": 89422352,
"domNodes": -308,
"jsHeapTotalBytes": -2494464,
"scriptDurationMs": 792.091,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.794573643410853,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3436.6729999999848,
"styleRecalcs": 69,
"styleRecalcDurationMs": 6.320999999999999,
"layouts": 60,
"layoutDurationMs": 14.825,
"taskDurationMs": 1444.334,
"heapDeltaBytes": 12056528,
"heapUsedBytes": 79837356,
"domNodes": 24,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 745.768,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666504854368934,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3522.3159999999325,
"styleRecalcs": 72,
"styleRecalcDurationMs": 7.765,
"layouts": 60,
"layoutDurationMs": 15.716000000000001,
"taskDurationMs": 1657.6480000000001,
"heapDeltaBytes": -11962868,
"heapUsedBytes": 73947380,
"domNodes": 24,
"jsHeapTotalBytes": 561152,
"scriptDurationMs": 782.5120000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665876777251185,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 2640.0979999999663,
"styleRecalcs": 41,
"styleRecalcDurationMs": 3.9360000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1679.5430000000001,
"heapDeltaBytes": 23019424,
"heapUsedBytes": 92380868,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 953.152,
"eventListeners": 182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.771974522292993,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2558.221000000003,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.524999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1654.9229999999998,
"heapDeltaBytes": -11280684,
"heapUsedBytes": 75347376,
"domNodes": 0,
"jsHeapTotalBytes": 1085440,
"scriptDurationMs": 939.425,
"eventListeners": 182,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.886754966887416,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2007.6970000000074,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.9759999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 517.477,
"heapDeltaBytes": 25354804,
"heapUsedBytes": 96279316,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 30.395000000000007,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760327,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2014.189999999985,
"styleRecalcs": 9,
"styleRecalcDurationMs": 3.1879999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 516.124,
"heapDeltaBytes": 759668,
"heapUsedBytes": 86418196,
"domNodes": 0,
"jsHeapTotalBytes": -225280,
"scriptDurationMs": 29.108999999999995,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 591.8139999999994,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.764,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 409.78000000000003,
"heapDeltaBytes": 14200276,
"heapUsedBytes": 78282128,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 146.852,
"eventListeners": 46,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66285714285714,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 597.7219999999761,
"styleRecalcs": 45,
"styleRecalcDurationMs": 4.954999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 439.635,
"heapDeltaBytes": -23689028,
"heapUsedBytes": 68802856,
"domNodes": -230,
"jsHeapTotalBytes": -2621440,
"scriptDurationMs": 137.642,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.142857142857142,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2009.190999999987,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.7090000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 434.2780000000001,
"heapDeltaBytes": 9420232,
"heapUsedBytes": 75107212,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.070000000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2020.815999999968,
"styleRecalcs": 10,
"styleRecalcDurationMs": 3.5249999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 441.226,
"heapDeltaBytes": 9145976,
"heapUsedBytes": 75786012,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.177,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1693.961999999999,
"styleRecalcs": 60,
"styleRecalcDurationMs": 15.594,
"layouts": 16,
"layoutDurationMs": 6.021,
"taskDurationMs": 751.8549999999999,
"heapDeltaBytes": -303788,
"heapUsedBytes": 63968356,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 102.06800000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1693.2679999999891,
"styleRecalcs": 76,
"styleRecalcDurationMs": 15.803999999999998,
"layouts": 16,
"layoutDurationMs": 5.562,
"taskDurationMs": 752.899,
"heapDeltaBytes": -157844,
"heapUsedBytes": 66542660,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 102.735,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 899.9690000000555,
"styleRecalcs": 19,
"styleRecalcDurationMs": 28.565,
"layouts": 6,
"layoutDurationMs": 14.497999999999998,
"taskDurationMs": 717.4369999999999,
"heapDeltaBytes": 33858232,
"heapUsedBytes": 114470840,
"domNodes": 14650,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 26.323,
"eventListeners": 2456,
"totalBlockingTimeMs": 128,
"frameDurationMs": 21.43095238095237,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8318.329999999947,
"styleRecalcs": 250,
"styleRecalcDurationMs": 18.295,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5478.788,
"heapDeltaBytes": -16130496,
"heapUsedBytes": 89696852,
"domNodes": -308,
"jsHeapTotalBytes": -1253376,
"scriptDurationMs": 2580.887,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666064257028115,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8439.345000000003,
"styleRecalcs": 250,
"styleRecalcDurationMs": 18.258,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5539.65,
"heapDeltaBytes": 6312148,
"heapUsedBytes": 89309452,
"domNodes": 0,
"jsHeapTotalBytes": 1540096,
"scriptDurationMs": 2693.705,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66587771203156,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17870.475,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17098.416,
"heapDeltaBytes": -40081448,
"heapUsedBytes": 186139124,
"domNodes": -3046,
"jsHeapTotalBytes": 1679360,
"scriptDurationMs": 258.14500000000004,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.38418367346939,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-large-graph-idle",
"durationMs": 17855.02000000008,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17040.516,
"heapDeltaBytes": -16437000,
"heapUsedBytes": 184031368,
"domNodes": -3046,
"jsHeapTotalBytes": 4579328,
"scriptDurationMs": 260.39199999999994,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.20169204737732,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-large-graph-pan",
"durationMs": 22342.061,
"styleRecalcs": 180,
"styleRecalcDurationMs": 14.016,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21902.474,
"heapDeltaBytes": -25746864,
"heapUsedBytes": 191198440,
"domNodes": -3046,
"jsHeapTotalBytes": 6049792,
"scriptDurationMs": 850.692,
"eventListeners": -14913,
"totalBlockingTimeMs": 8,
"frameDurationMs": 40.75273722627738,
"p95FrameDurationMs": 83.39999999999964
},
{
"name": "vue-large-graph-pan",
"durationMs": 15406.633000000056,
"styleRecalcs": 72,
"styleRecalcDurationMs": 6.249999999999978,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14901.898,
"heapDeltaBytes": -24078188,
"heapUsedBytes": 192935876,
"domNodes": -3046,
"jsHeapTotalBytes": 3620864,
"scriptDurationMs": 806.2210000000001,
"eventListeners": -14913,
"totalBlockingTimeMs": 71,
"frameDurationMs": 27.218342151675483,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "vue-node-resize-workload",
"durationMs": 4699.286000000029,
"styleRecalcs": 20,
"styleRecalcDurationMs": 75.45400000000002,
"layouts": 20,
"layoutDurationMs": 23.46100000000001,
"taskDurationMs": 4577.775999999999,
"heapDeltaBytes": 988824,
"heapUsedBytes": 217987584,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 84.83200000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 15,
"frameDurationMs": 25.682513661202194,
"p95FrameDurationMs": 50
},
{
"name": "vue-node-resize-workload",
"durationMs": 6457.63199999999,
"styleRecalcs": 20,
"styleRecalcDurationMs": 74.23000000000002,
"layouts": 20,
"layoutDurationMs": 23.041000000000007,
"taskDurationMs": 6318.432000000001,
"heapDeltaBytes": -13732012,
"heapUsedBytes": 216425724,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 104.25000000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 37.59476744186047,
"p95FrameDurationMs": 83.29999999999927
},
{
"name": "vue-zoom-out-idle",
"durationMs": 9358.459000000039,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8914.207999999999,
"heapDeltaBytes": -31117148,
"heapUsedBytes": 189636352,
"domNodes": -3046,
"jsHeapTotalBytes": 11534336,
"scriptDurationMs": 141.42399999999995,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.1172757475083,
"p95FrameDurationMs": 66.59999999999854
},
{
"name": "vue-zoom-out-idle",
"durationMs": 9233.514000000014,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8728.034,
"heapDeltaBytes": -28189208,
"heapUsedBytes": 189863420,
"domNodes": -3046,
"jsHeapTotalBytes": 13389824,
"scriptDurationMs": 132.79399999999995,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 30.316776315789472,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "workflow-execution",
"durationMs": 187.91300000009414,
"styleRecalcs": 13,
"styleRecalcDurationMs": 15.620999999999999,
"layouts": 5,
"layoutDurationMs": 3.6220000000000003,
"taskDurationMs": 177.50500000000002,
"heapDeltaBytes": -49278648,
"heapUsedBytes": 58766464,
"domNodes": -58,
"jsHeapTotalBytes": -1048576,
"scriptDurationMs": 13.059000000000001,
"eventListeners": -122,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.51111111111105,
"p95FrameDurationMs": 33.30000000000018
},
{
"name": "workflow-execution",
"durationMs": 105.14499999999316,
"styleRecalcs": 7,
"styleRecalcDurationMs": 8.917000000000002,
"layouts": 3,
"layoutDurationMs": 1.0930000000000002,
"taskDurationMs": 68.45800000000001,
"heapDeltaBytes": 4166500,
"heapUsedBytes": 72098332,
"domNodes": 98,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 6.142000000000001,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 748.3249999999089,
"styleRecalcs": 77,
"styleRecalcDurationMs": 85.56700000000001,
"layouts": 76,
"layoutDurationMs": 23.063,
"taskDurationMs": 712.609,
"heapDeltaBytes": 16811148,
"heapUsedBytes": 90428364,
"domNodes": 77,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 287.216,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 764.9240000000646,
"styleRecalcs": 77,
"styleRecalcDurationMs": 86.257,
"layouts": 76,
"layoutDurationMs": 22.543,
"taskDurationMs": 734.286,
"heapDeltaBytes": 17240156,
"heapUsedBytes": 90829128,
"domNodes": 77,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 307.73799999999994,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66808510638297,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1379.2570000000524,
"styleRecalcs": 77,
"styleRecalcDurationMs": 243.654,
"layouts": 76,
"layoutDurationMs": 27.033,
"taskDurationMs": 1352.234,
"heapDeltaBytes": -18884172,
"heapUsedBytes": 119104676,
"domNodes": 77,
"jsHeapTotalBytes": 1835008,
"scriptDurationMs": 459.175,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.07777777777779,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1408.335999999963,
"styleRecalcs": 77,
"styleRecalcDurationMs": 253.557,
"layouts": 76,
"layoutDurationMs": 28.764000000000003,
"taskDurationMs": 1390.9070000000002,
"heapDeltaBytes": 10652572,
"heapUsedBytes": 119846044,
"domNodes": 77,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 500.147,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.707500000000003,
"p95FrameDurationMs": 33.29999999999927
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 6b0f2bd013fa16c33932085ba519cf8967b03fa7
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
There was a problem hiding this comment.
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 `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts`:
- Around line 80-101: Make BeforeSendEvent require properties instead of leaving
it optional, since stampPlatformAxes reads event.properties.client
unconditionally and the current helper invariant assumes properties is always
present. Update the BeforeSendEvent type and keep runBeforeSend and its callers
aligned with that contract so any future test that omits properties fails at
compile time rather than at runtime.
In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts`:
- Around line 155-157: The initialization flow in PostHogTelemetryProvider is
flushing buffered events before desktop attribution is available. In the setup
path that calls flushEventQueue(), readDesktopEntryProps() and
registerDesktopEntryProps() must run first so pre-init events retain source_app
and desktop_device_id. Reorder these calls in the relevant initialization method
of PostHogTelemetryProvider so desktop entry props are registered before any
queued events are sent.
🪄 Autofix (Beta)
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: 5d49a175-0335-49a8-9312-78e53c2a4d82
📒 Files selected for processing (2)
src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.tssrc/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 248a65b975
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const props = readDesktopEntryProps() | ||
| if (!props) return | ||
| this.desktopEntryProps = props | ||
| if (!this.posthog || !this.desktopEntryProps) return |
There was a problem hiding this comment.
Restore persisted desktop props after reload
When a user enters from desktop, posthog.register() persists source_app/desktop_device_id across full page reloads, but a later reload usually no longer has the original utm_source in window.location.search, so desktopEntryProps is null. If that user then logs out, reset(true) wipes the persisted super properties and this guard prevents re-registering them, so anonymous events in the same SPA session lose the desktop attribution this change is meant to preserve; hydrate the cache from the existing PostHog super properties or another non-reset store before resetting.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The updated branch reads validated saved source_app: 'desktop' and optional string device ID before logout, then restores only those referral fields after reset(true). Fresh Desktop URLs take precedence. Regression tests cover clean-URL reload followed by logout. Saved metadata restored on a clean-URL reload does not establish a person's Desktop visit. A fresh Desktop URL still establishes the visit across account switches on that page, preserving the existing flow where the Desktop user signs out of the wrong Cloud account.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #13503 +/- ##
==========================================
+ Coverage 85.68% 86.65% +0.97%
==========================================
Files 3547 2531 -1016
Lines 170202 143642 -26560
Branches 46644 39537 -7107
==========================================
- Hits 145836 124472 -21364
+ Misses 22362 18784 -3578
+ Partials 2004 386 -1618
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1250 files with indirect coverage changes 🚀 New features to boost your workflow:
|
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: changes requested
P1: The logout restore still loses desktop attribution after a clean-URL reload. posthog.register() persists source_app and desktop_device_id, but this provider initializes desktopEntryProps only from the current query string. If the page reloads without the original UTM parameters, reset(true) clears PostHog persistence and the null instance cache restores nothing. This defeats the stated logout-reset fix. Please hydrate the cache from validated persisted PostHog properties when the entry URL no longer has them, and add the reload-before-logout regression case.
The branch also conflicts with current main in the before_send test. I did not resolve that conflict in this review round.
Existing findings confirmed or contested
- Confirmed P1: the clean-URL reload finding. PostHog 1.358.1 persists registered properties and clears them during reset, while this provider repopulates its cache only through
readDesktopEntryProps()fromwindow.location.search. - Confirmed P2: the test callback type finding. The installed callback contract requires
uuid,event, andproperties, and permits nullable input and output. The newBeforeSendEventtype is a weaker parallel contract. I would use PostHog's exportedCaptureResultandBeforeSendFntypes instead. - Contested: the queue ordering finding. The base revision already registers desktop entry properties after
flushEventQueue(), so this PR does not introduce or worsen that ordering. The changed queue guarantee is forclientanddeployment, andbefore_sendstamps those axes at capture time.
Finding without an inline anchor
- P3: The PR description says Customer.io reset only clears
_userand_group. The installed implementation also emits a reset event to plugins, and the InApp plugin clears its user token and custom attributes. The conclusion that the plugin remains installed is correct, but the exclusive "only" claim should be narrowed.
Checked and cleared
- The composed
before_sendchain keepsclientanddeploymentindependent of resettable super properties. - The server-supplied
before_sendcannot replace the PII filter because the local chain is assigned after the server config spread. - Customer.io keeps the InApp plugin installed across reset, so no provider code change is needed there.
- Added lines contain none of the repository's prohibited
any, double assertion, suppression, raw telemetry sink, Tailwind, or PrimeVue patterns.
Coverage and checks
Standard-depth correctness, maintainability, idiomaticity, tests, and documentation lanes reviewed both changed files without sampling. The lanes applied the standard blast-radius, regression-history, lifecycle, boundary, simplicity, comment, TypeScript, test-quality, mock-boundary, and proof lenses. No Playwright lane was applicable. Fallow is unavailable on this base.
At 248a65b97571684385a286b3d867b87342f8f0c7, the focused Vitest file passed 47 tests, pnpm typecheck passed, targeted ESLint passed, and targeted oxfmt passed. GitHub reports 40 successful and 21 skipped check runs, with no failed or pending check runs. I also merged the head into current main locally to inspect integration: production merged automatically, while PostHogTelemetryProvider.test.ts has one content conflict. I did not run combined-base tests because that conflict remains unresolved.
| currentUser.onUserLogout(() => { | ||
| this.posthog?.reset(true) | ||
| // reset(true) wipes super properties; restore desktop entry | ||
| // attribution for the rest of the SPA session. |
There was a problem hiding this comment.
P3: This comment paraphrases the adjacent reset(true) and registerDesktopEntryProps() calls. The earlier stampPlatformAxes comment already records the non-obvious SDK behavior, so I would delete these two lines rather than maintain a second description of the same sequence.
There was a problem hiding this comment.
The redundant two-line comment is absent from the updated branch; the non-obvious SDK explanation remains beside stampPlatformAxes.
There was a problem hiding this comment.
Addressed in e1eedd3: the logout handler no longer has the paraphrasing comment.
248a65b to
0e14aa1
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: changes requested
Commit 0e14aa1 addresses the prior clean-URL reload defect and replaces the hand-written before_send contract with PostHog's SDK types. Commit 4a3d12e removes the redundant logout comment, and the current description fixes the earlier reset-scope wording. I also rechecked the earlier queue-order comment: that desktop registration order predates this PR, while the changed platform axes are stamped by before_send.
Two blocking issues remain, both detailed inline. A new desktop entry without a device ID retains an older persisted ID because PostHog registration merges properties. Separately, the required test check fails because this new get_property dependency is missing from the current-main PostHog boundary mock; I reproduced the same failure on the merge tree with live main.
Checks: focused provider suite 85/85 passed; typecheck, targeted ESLint, type-aware Oxlint, formatting, and Knip passed. The clean-URL regression test fails against pre-repair commit 29a848a and passes at this head. The installed PostHog 1.402.3 contract experiment reproduced stale-key retention. The live-main merge test ran 90 focused tests with 1 failure in storeReadinessGate.test.ts, matching CI. GitHub currently reports 81 successful, 14 skipped, and 1 failed check (test).
4a3d12e to
e1eedd3
Compare
Swarmhost agentic reviewThe detailed evaluation is available to employees in the internal Slack review thread. Evaluation failed to run ( Evaluation budget remaining for this pull request: 98 automatic and 99 manual. Updated by Swarmhost's agentic review process. |
There was a problem hiding this comment.
Verdict: ready for human review
I reviewed 470fdaf. The author pushed 3e9b8ce, ff65722 and 470fdaf while I was reviewing e1eedd3, so the comments below are anchored to 470fdaf. Both blocking findings from my last review are fixed. The stale device ID is now unregistered when a new Desktop entry has no ID, and the store-readiness PostHog mock now has get_property and unregister. I also had a P2 question ready about restored attribution reaching people.set for the next account after a clean reload. 3e9b8ce fixed that before I posted: person properties now require source === 'url', and if I remove that check, keeps saved referral props on events without writing Desktop attribution to a new person profile fails.
What's left are nine P3 items, all inline. One is a rare cross-tab edge that I'm fine leaving documented. The other eight are test and idiom cleanups. None of them blocks merge.
Review record
Round 1 (review, head 248a65b):
- P1, a clean-URL reload left desktop attribution empty, so logout restored nothing. I confirmed the Codex finding. Addressed: validated persisted attribution is restored, and the regression test fails against base production code.
- P2, the test helper hand-declared a weaker
before_sendtype. I confirmed the CodeRabbit finding. Addressed: the helper now uses SDKCaptureResultandBeforeSendFn. - I contested the CodeRabbit queue-order finding as pre-existing. Now moot:
e1eedd3registers attribution beforeflushEventQueue, and a test fails if the order flips. - P3, a redundant logout comment (thread). Addressed in
e1eedd3(reply). - P3, the PR body overstated Customer.io reset behavior. Addressed: the body was rewritten.
Round 2 (review, head 4a3d12e):
- P1, the
storeReadinessGate.test.tsmock lackedget_property, which failed CI (thread). Addressed ine1eedd3(reply). - P1, a new Desktop URL without an ID kept the old persisted
desktop_device_id(thread). Addressed ine1eedd3(reply). Real posthog-js 1.402.3 confirmsunregisterfollowed byregisterdrops the key.
Round 3 (this review, head 470fdaf):
- P2, persisted attribution wrote person properties for the next account. Addressed in
3e9b8ce/470fdafbefore I posted. Fresh-visit attribution across a same-page account switch is intended, and the PR body says so. - P3, the PR body gave no reason for skipping E2E on a fix PR. Addressed: the body now explains it.
- The nine P3 inline comments in this review are open.
Checks at 470fdaf:
- Telemetry Vitest: 41 files, 631/631 passed.
- Passed:
pnpm typecheck, changed-file ESLint, type-aware Oxlint, oxfmt andpnpm knip. - Red on base: the head tests run against base production code fail 15 cases.
- Mutations: removing
unregister, flushing before registering, dropping the logout re-register, and dropping thesource === 'url'check each fail at least one test. - GitHub checks at the time of posting: 33 succeeded, 30 skipped, 3 still running (including
lint-pr / typecheck). On the earlier heads, the failed and cancelled jobs came from runs that newer pushes cancelled, not from test failures.
| // pre-init logout handling would defeat the simplification. | ||
| currentUser.onUserLogout(() => { | ||
| this.posthog?.reset(true) | ||
| this.registerDesktopEntryProps() |
There was a problem hiding this comment.
P3: On a cross-tab sign-out, every open tab runs this handler and re-registers the props it captured at init. Persistence is last-writer-wins. If an older tab opened under old-device runs last, it restores old-device over a newer Desktop entry's ID, and the next clean-URL load keeps it. Before this change, logout wiped the key. I reproduced the SDK side with two posthog-js 1.402.3 instances sharing localStorage. It needs two tabs from two Desktop installs, so it is rare. Either document it next to the existing comment about the pre-init logout race, or re-read URL-or-persisted attribution just before reset().
| ? params.get('desktop_device_id') | ||
| : posthog.get_property('desktop_device_id') | ||
| if (typeof deviceId === 'string' && deviceId) { | ||
| props.desktop_device_id = deviceId |
There was a problem hiding this comment.
P3: These rewritten lines build props and then mutate it, which goes against AGENTS.md's "assignment at point of declaration". A direct return compiles and passes the suite:
const props: DesktopEntryProps =
typeof deviceId === 'string' && deviceId
? { source_app: 'desktop', desktop_device_id: deviceId }
: { source_app: 'desktop' }There was a problem hiding this comment.
Done in 6b29645: props is now assigned once at declaration from the device-ID ternary.
| const initConfig = hoisted.mockInit.mock.calls[0][1] | ||
| assert.exists(initConfig) | ||
|
|
||
| expect(initConfig.before_send).not.toBe(remoteBefore_send) |
There was a problem hiding this comment.
P3: before_send is now always the array literal from production, so it can never be identical to remoteBefore_send. This line can't fail; only the not.toContain below protects the PII chain. Please delete this line.
There was a problem hiding this comment.
Done in 6b29645: deleted the not.toBe(remoteBefore_send) assertion; the not.toContain check remains.
|
|
||
| function mockPostHogPersistence(initial: Record<string, unknown> = {}) { | ||
| const persisted = new Map(Object.entries(initial)) | ||
| hoisted.mockRegister.mockImplementation((props: Record<string, unknown>) => { |
There was a problem hiding this comment.
P3: This hand-written Record<string, unknown> is needed only because mockRegister is an untyped vi.fn(). The sibling mocks already use SDK types (PostHog['init'], PostHog['unregister']). With const mockRegister = vi.fn<PostHog['register']>(), this parameter infers Properties and the annotation can go. I checked that typecheck and the suite pass with that change.
There was a problem hiding this comment.
Done in 6b29645: mockRegister is now vi.fn<PostHog['register']>(), and the Record<string, unknown> annotation is gone.
| const config = hoisted.mockInit.mock.calls[0][1] | ||
| assert.exists(config?.before_send) | ||
| const { before_send } = config | ||
| const chain: BeforeSendFn[] = Array.isArray(before_send) |
There was a problem hiding this comment.
P3: After assert.exists, both branches already infer BeforeSendFn[], so the annotation and the BeforeSendFn import add nothing. const chain = Array.isArray(before_send) ? before_send : [before_send] compiles.
There was a problem hiding this comment.
Done in 6b29645: dropped the BeforeSendFn[] annotation and the BeforeSendFn import.
| return persisted | ||
| } | ||
|
|
||
| function setLocation(search: string): void { |
There was a problem hiding this comment.
P3: This helper is now at module scope and used in a second describe. Object.defineProperty(window.location, 'search', ...) leaves an own property that setLocation('') resets but never removes, so a later test that navigates with history.replaceState still reads search === ''. I reproduced that ordering dependence. Eight other test files set the URL with window.history.replaceState({}, '', /${search}). That approach needs no shadowing, and one root afterEach could reset it in place of the two describe-level hooks.
There was a problem hiding this comment.
Done in 6b29645: setLocation now uses window.history.replaceState, and one root afterEach replaces the two describe-level resets.
| it('registers platform axes before flushing pre-init queued events', async () => { | ||
| const provider = createProvider() | ||
| provider.trackSignupOpened() | ||
| it('keeps stamping platform axes after logout wipes super properties', async () => { |
There was a problem hiding this comment.
P3: stampPlatformAxes holds no state and reset is a bare mock here, so calling logout() can't change what this test asserts. It fails in exactly the same cases as stamps client=web..., and the reset(true) assertion repeats calls posthog.reset(true) when the watcher fires. The clean-URL reload test already checks the axes after logout. I'd delete this test.
There was a problem hiding this comment.
Done in 6b29645: deleted this test.
| }) | ||
| }) | ||
|
|
||
| it('attributes queued events to the new desktop entry instead of an old device', async () => { |
There was a problem hiding this comment.
P3: This test does observe real ordering, since the capture fake snapshots persistence at call time and the flush-first mutation fails only here. But it also runs the before_send chain and expects client/deployment, and it fails on the no-unregister mutation too. So when it goes red, it doesn't say whether ordering or stale-ID cleanup broke. Recording Object.fromEntries(persisted) directly and using a URL with desktop_device_id=new-device would make ordering the only thing that can fail it.
There was a problem hiding this comment.
Done in 6b29645: the capture fake now records Object.fromEntries(persisted) directly, and the URL carries desktop_device_id=new-device. Flushing before registering fails only this test.
| expect(hoisted.mockPosthogReset).toHaveBeenCalledWith(true) | ||
| }) | ||
|
|
||
| it('re-registers desktop entry props after reset wipes super properties', async () => { |
There was a problem hiding this comment.
P3: Removing the logout re-register, registering before reset, and removing reset each fail this test, but they also fail the prefers a new desktop entry URL rows or calls posthog.reset(true). Its previous_user_property assertion only checks that the fake's reset clears the Map. It has no unique falsifier, so I'd delete it.
There was a problem hiding this comment.
Done in 6b29645: deleted this test.
| // Stamped via before_send rather than posthog.register() so the axes | ||
| // survive the posthog.reset(true) on logout, which wipes super properties. |
There was a problem hiding this comment.
| // Stamped via before_send rather than posthog.register() so the axes | |
| // survive the posthog.reset(true) on logout, which wipes super properties. |
There was a problem hiding this comment.
Done in 6b29645: removed both comment lines above stampPlatformAxes.
comfy-greenlight-bot
left a comment
There was a problem hiding this comment.
This pull request at head commit 470fdaf has been reviewed and approved by Swarmhost's agentic review process.
The detailed evaluation is available to employees in the internal Slack review thread.
issues for this review specifically got fixed, doing the rest in a fast followup with greenlight
6b29645
There was a problem hiding this comment.
Verdict: ready for human review
I reviewed 6b29645. It applies the round-3 cleanups and the deletion of the stampPlatformAxes comment. The production change is behavior-preserving. One of those cleanups was my mistake. In round 3 I called expect(initConfig.before_send).not.toBe(remoteBefore_send) vacuous (comment), and it was not. It was the only check that fails if ...serverConfig is spread after before_send. With that order flipped, all 115 tests in this file pass on this head. With the line restored, the test fails. The inline comment at line 2018 has a behavioral replacement that I verified. Production is correct today, so this is a test gap rather than a defect, but it is the one thing I'd like fixed before merge. The rest are P3 test and naming cleanups.
Cross-tab logout (P3, still open, thread). I checked #18780 against it. #18780 leaves useCurrentUser().onUserLogout as a watch that fires whenever resolvedUserInfo drops to null. That still includes another window's Firebase auth sync and reauthentication recovery, so this provider's reset(true) plus re-register still runs in tabs that did not sign out. The reset(true) is pre-existing on main. The re-register is what this PR adds, and it is what can write an older tab's device ID back. #18780 neither fixes nor worsens that. The merged tree of this PR and #18780 passes 878 tests across telemetry, auth and workflow persistence, plus 116/116 in this file, so the two don't conflict. I'm fine with this landing as a documented known limitation. One sentence in the PR body or beside the existing logout-race comment would do.
Review record
Round 1 (review, head 248a65b):
- P1, a clean-URL reload left desktop attribution empty, so logout restored nothing. I confirmed the Codex finding. Addressed: validated persisted attribution is restored, and the regression test fails against
main's production code. - P2, the test helper hand-declared a weaker
before_sendtype. I confirmed the CodeRabbit finding. Addressed: SDKCaptureResulttypes. - I contested the CodeRabbit queue-order finding as pre-existing. Addressed anyway in
e1eedd3: attribution is registered before the flush, and the queued-event test fails if the order flips. - P3, a redundant logout comment (thread). Addressed in
e1eedd3(reply). - P3, the PR body overstated Customer.io reset behavior. Addressed: the body was rewritten.
Round 2 (review, head 4a3d12e):
- P1, the
storeReadinessGate.test.tsmock lackedget_property, which failed CI (thread). Addressed ine1eedd3(reply). - P1, a new Desktop URL without an ID kept the old persisted
desktop_device_id(thread). Addressed ine1eedd3(reply). Verified against real posthog-js 1.402.3.
Round 3 (review, head 470fdaf):
- P2, persisted attribution wrote person properties for the next account. Addressed in
3e9b8ce/470fdafbefore the review was posted. - P3, the body gave no reason for skipping E2E. Addressed in the body.
- P3, the cross-tab logout edge (thread). Open, see above.
- P3, build-then-mutate
props(thread). Addressed in6b29645(author reply). - P3, the "vacuous"
not.toBe(remoteBefore_send)(thread). Withdrawn: my finding was wrong, and its deletion is the P2 at line 2018 in this review. - P3, type
mockRegisterfrom the SDK (thread). Addressed in6b29645(author reply). - P3, the redundant
BeforeSendFn[]annotation (thread). Addressed in6b29645(author reply). - P3, the
definePropertylocation shadow (thread). Addressed in6b29645withreplaceState(author reply). - P3, the axes-after-logout test had no unique falsifier (thread). Deleted in
6b29645(author reply). Removingdeploymentstamping still fails 4 tests. - P3, the queued-event test over-asserted (thread). Rewritten in
6b29645(author reply). Flushing before register now fails only this test. - P3, the re-register-after-reset test had no unique falsifier (thread). Deleted in
6b29645(author reply). Dropping the logout re-register still fails 8 tests. - DrJKL: delete the
stampPlatformAxescomment (suggestion). Addressed in6b29645(author reply).
Round 4 (this review, head 6b29645):
- P2, the
before_sendoverride guard is missing (line 2018). Open. - Eight P3 inline comments in this review: open.
Checks at 6b29645:
- Telemetry Vitest: 41 files, 629/629 passed.
- Passed:
pnpm typecheck, changed-file ESLint, type-aware Oxlint, oxfmt andpnpm knip. - Mutations: removing
unregister(1 fail), flushing before register (1), dropping the logout re-register (8), registering before reset (8), droppingdeploymentstamping (4), dropping thesource === 'url'check (1), spreadingserverConfiglast (0, the P2). - Combined with #18780: 878 passed, 1 expected fail.
- GitHub checks: 105 succeeded, 35 skipped, none failed.
| assert.exists(initConfig) | ||
|
|
||
| expect(initConfig.before_send).not.toBe(remoteBefore_send) | ||
| expect(initConfig.before_send).not.toContain(remoteBefore_send) |
There was a problem hiding this comment.
P2: I was wrong in round 3 to call the deleted not.toBe(remoteBefore_send) vacuous. It was the only assertion that fails when ...serverConfig is spread after before_send. In that case before_send becomes the bare remote function, and not.toContain still passes, because a function isn't an array. I moved the spread after before_send on this head and all 115 tests in the file passed. Asserting behavior covers both override shapes, and I verified it fails for "remote replaces" and "remote appended":
const result = runBeforeSend({
uuid: 'test',
event: 'test',
properties: { email: 'pii@example.com' }
})
expect(remoteBefore_send).not.toHaveBeenCalled()
expect(result?.properties).not.toHaveProperty('email')| const config = hoisted.mockInit.mock.calls[0][1] | ||
| assert.exists(config?.before_send) | ||
| const { before_send } = config | ||
| const chain = Array.isArray(before_send) ? before_send : [before_send] |
There was a problem hiding this comment.
P3: Production always passes an array ([stampPlatformAxes, createPostHogBeforeSend()]), so the non-array branch never runs, and it would quietly accept a regression back to a single callback. assert.isArray(before_send) followed by before_send.reduce(...) removes the ternary and the chain local.
| } | ||
| }) | ||
|
|
||
| afterEach(() => { |
There was a problem hiding this comment.
P3: vitest.timer.setup.ts already runs window.history.replaceState({}, '', '/') before every test in the frontend project, so this root afterEach and the leading setLocation('') calls at lines 355, 451 and 519 repeat it. I removed them and every test still passed, including across shuffled seeds. The mid-test setLocation('') at 1802 is the one that matters.
| ) | ||
| }) | ||
|
|
||
| it('keeps saved referral props on events without writing Desktop attribution to a new person profile', async () => { |
There was a problem hiding this comment.
P3: In src/platform/telemetry "referral" means Rewardful (rewardful_referral), while this code calls it persisted desktop attribution (source: 'persisted'). Suggest keeps persisted desktop attribution on events without writing it to a new person profile.
| desktop_device_id: 'previous-device' | ||
| }) | ||
| const events: Array<CaptureResult | null> = [] | ||
| hoisted.mockCapture.mockImplementation((event: string) => { |
There was a problem hiding this comment.
P3: Same cleanup as mockRegister: const mockCapture = vi.fn<PostHog['capture']>() lets this be (event) => without the hand-written string. Typecheck passes with that change.
| callback({ id: 'different-user' }) | ||
| provider.trackSignupOpened() | ||
|
|
||
| expect(hoisted.mockIdentify).toHaveBeenCalledWith('different-user') |
There was a problem hiding this comment.
P3: The identify('different-user') assertion only proves the test's own callback ran, and the persisted-state toEqual is implied by the events assertion, which reads the same Map. Both can go; the person-property assertions carry the test.
| expect.objectContaining({ desktop_device_id: 'device-xyz' }) | ||
| ) | ||
| expect(hoisted.mockPeopleSetOnce).toHaveBeenCalledOnce() | ||
| hoisted.mockPeopleSet.mockClear() |
There was a problem hiding this comment.
P3: The first-identify assertions and the two mockClear calls re-check what persists desktop props to the person on identify... (line 412) already covers. This test's unique falsifier is a once-per-page guard on person props. Asserting mockPeopleSetOnce was called twice after both identifies, with no clears, states that directly.
| } | ||
| ) | ||
|
|
||
| it('does not register anything on logout for non-desktop visitors', async () => { |
There was a problem hiding this comment.
P3: The restores only valid persisted attribution row { source: undefined, deviceId: 'saved-device', expected: {} } covers this path. The only defect this test catches alone is a no-op register({}) on logout, which has no observable effect. I'd keep the row and delete this test.
|
|
||
| describe('before_send', () => { | ||
| it('strips PII keys from event properties, $set, and $set_once', async () => { | ||
| it('preserves dropped events through the callback chain', async () => { |
There was a problem hiding this comment.
P3: posthog-js 1.402.3 stops the hook chain at the first nullish result (_runBeforeSend, posthog-core.js around line 3702), and stampPlatformAxes runs first, so no hook ever receives null. This test exercises the runBeforeSend helper, not SDK behavior. I'd delete it.
Summary
PostHog logout resets currently erase platform metadata and Desktop referral attribution, including after a clean-URL reload. Stamp platform fields on each event, restore validated browser referral metadata after logout, clear an old device ID when a fresh Desktop entry omits it, and initialize attribution before flushing buffered events.
Saved browser referral metadata persists across reloads and logout without an application expiry, until a new Desktop entry replaces it or browser storage is cleared. Person-profile attribution and Desktop visit timestamps are updated only on a page opened from a fresh Desktop entry URL. This remains true across logout and account switches on that page, preserving the existing flow where a Desktop user switches out of the wrong Cloud account. Metadata restored on a clean-URL reload does not establish a signed-in person's Desktop visit. Logout still resets user identity and unrelated super properties.
Verification