Skip to content

Sessions: filters, search, and geo/device context (#192)#269

Merged
unjica merged 2 commits into
developfrom
feature/sessions-192
Jul 7, 2026
Merged

Sessions: filters, search, and geo/device context (#192)#269
unjica merged 2 commits into
developfrom
feature/sessions-192

Conversation

@unjica

@unjica unjica commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds sessions list search (user id, email, country, device) and Environment, Release, and Country filters aligned with overview Event EXISTS joins for env/release
  • Extends Session schema + POST /ingest/session with country, device_browser, device_os, and user_email; SDK sends browser/OS/country context and patches identity on identify(id, { email })
  • Updates SessionsListToolbar, enriched SessionsTable (country flag + device columns, optional email), and session detail meta

Closes #192

Test plan

  • pnpm lint && pnpm test && pnpm build
  • Apply migration 20260708120000_session_geo_device_email in dev/staging
  • Sessions page: search by user id; filter by environment/release/country
  • Ingest a session from browser SDK; verify country/device columns populate
  • Call identify(userId, { email }); verify email shows in table and detail

Made with Cursor

Ship search and Environment/Release/Country filters on the sessions page, persist country/device/email on Session ingest, and surface context in the enriched table and detail view.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/sessions-page-summary.ts
Use a single Event EXISTS clause when both filters are set so one event row must match environment and release, matching events list semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 625e124. Configure here.

const cfg = getConfigOrNull();
if (cfg && sessionId) {
void postSession(cfg);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale email after user switch

Medium Severity

identify only updates in-memory userEmail when traits include email, but always posts the current session afterward. Calling identify with a new user id without traits leaves the previous email attached and sends it with the new user_id, so the dashboard can show the wrong email for that session.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 625e124. Configure here.

platform: cfg.platform ?? undefined,
environment: cfg.environment ?? undefined,
user_id: userId ?? undefined,
user_email: userEmail ?? undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cleared identity not persisted

Medium Severity

Session ingest updates only fields present in the JSON body, but buildSessionPayload drops null user_id and user_email via ?? undefined, so they are omitted from the request. identify(null) or { email: null } clears client state yet leaves the stored session row unchanged, so list and detail views can still show the old identity.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 625e124. Configure here.

@unjica unjica merged commit 68d2b83 into develop Jul 7, 2026
5 checks passed
@unjica unjica deleted the feature/sessions-192 branch July 7, 2026 22:00
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.

Sessions page: filters, search, and geo/device context ingest

1 participant