Commit c06f5de
committed
fix(profiles): review fixes — operators, profile.* filters, count/list parity
Addresses the cloud + CodeRabbit review findings on the profiles filter:
- All 15 filter operators (doesNotContain/startsWith/endsWith/regex/gt/lt/
gte/lte/isNull/isNotNull/…) via a shared operatorClause, in the v2, events
and profile-property builders. Was: everything unhandled fell through to IN
(e.g. doesNotContain returned the opposite audience).
- profile.* filters (profile.id / profile.properties.*) now apply to the outer
profiles query instead of being dropped — "did event X AND profile.id=Y" now
actually filters by id (was returning all profiles).
- Count/list parity: behavioural list no longer gates profiles.created_at
(first-seen) by the window — the event subquery bounds time — so the count
and rows agree (was 152 vs 8). Count now mirrors the list (behavioural
membership + profile.* filters + search + window) via a shared subquery.
- Pagination: offset = cursor (client already sends the row offset); removes
the (page-1)*take*take that made page 2+ empty.
- START_DATE guard: validate/anchor to UTC so a blank/garbled env falls back
instead of silently disabling the coverage gate; parse queryStart as UTC too.
- Nits: count input is a plain typed field (no spinner, no decimals → no 400);
LastSeenPicker restores the time toggle on reopen; drop unused imports; fix a
stale transformProfile comment.1 parent 23e838f commit c06f5de
4 files changed
Lines changed: 266 additions & 171 deletions
File tree
- apps/start/src/components/profiles
- table
- packages/db/src/services
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | | - | |
67 | | - | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
0 commit comments