Commit Graph

2779 Commits

Author SHA1 Message Date
Bilal Godil
e21c7cfeef Fix pause jumping to wrong time in session replay
Capture the current playback position when pausing by computing
pausedAtGlobalMs via computeDesiredGlobalOffset, so the player
freezes at the actual frame instead of jumping to a stale position.
2026-02-16 18:15:45 -08:00
Bilal Godil
b332297a96 merge dev 2026-02-16 17:22:07 -08:00
Konstantin Wohlwend
d8b3c5169f Improve dot-notation handling in config validation 2026-02-16 17:09:52 -08:00
Bilal Godil
f447c3943a web event tracking + storage 2026-02-16 15:02:49 -08:00
Armaan Jain
11b6b4210b
Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
BilalG1
c7ef526bb4
session replays (#1187)
https://www.loom.com/share/3b7c9288149e4f878693281778c9d7e0




## Todos (future PRs)
- Fix pre-login recording
- Better session search (filters, cmd-k, etc)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Analytics → Replays: session recording & multi-tab replay with
timeline, speed, seek, and playback settings; dashboard UI for listing
and viewing replays.

* **Admin APIs**
* Admin endpoints to list recordings, list chunks, fetch chunk events,
and retrieve all events (paginated).

* **Client**
* Client-side rrweb recording with batching, deduplication, upload API
and a send-batch client method.

* **Configuration**
  * New STACK_S3_PRIVATE_BUCKET for private session storage.

* **Tests**
* Extensive unit and end-to-end tests for replay logic, streams,
playback, and APIs.

* **Chores**
  * Removed an E2E API test GitHub Actions workflow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-16 14:15:17 -08:00
BilalG1
e1c9d8e0ef
Merge branch 'dev' into analytics-replays-4 2026-02-16 13:25:41 -08:00
Aman Ganapathy
fa360aba9c
[Refactor] Change Retry Logic in Email Sending (#1191)
### Context
Some of our users' emails were getting stuck in sending. The long delays
in processing the retries caused a vercel function timeout.

### Summary of Changes
We refactor the low level email sending functions to remove the retry
logic there. We kick it up to the email queue step. Additionally, we
flag emails to be retried when they encounter issues but leave it for a
future iteration to actually perform the retry. We perform an
exponential backoff with a random component to decide when they have to
be retried. We also make some small adjustments to the queuing function
to not queue skipped emails.

When an email fails to send during the sending function, we check to see
if it is a retryable error or not. Some errors are transient and trying
again may succeed while others indicate deeper issues. If it is
retryable, and the max number of retry attempts hasn't been reached, we
set `nextSendRetryAt` to a time determined by an exponential backoff
calculation function. When the queuing function looks for emails to
queue, it doesn't just pick up the `SCHEDULED`. emails whose
`scheduledAt` time <= `NOW()`, but also those emails whose
`nextSendRetryAt` time <= `NOW()`. What this means in practice is that
one iteration of the `email-queue-step` will mark emails as retryable
while another iteration will perform the retry. This should be cleaner
and prevent long delays in the `email-queue-step` process due to
retries. This also makes it easier to scale up the number of retries if
need be.
2026-02-16 21:07:16 +00:00
Konstantin Wohlwend
b255c5edda Increase trusted domain migration batch size 2026-02-16 12:22:17 -08:00
Konstantin Wohlwend
c7e8cde2ec Rename migration 2026-02-16 12:15:02 -08:00
Konstantin Wohlwend
5c4d9e049b chore: update package versions 2026-02-16 12:05:06 -08:00
Bilal Godil
e6b0cd0f82 merge dev 2026-02-16 11:55:24 -08:00
Konstantin Wohlwend
d9412902c8 Fix getActiveSessions error 2026-02-16 11:43:58 -08:00
Konsti Wohlwend
d319285403
Queries view (#1145) 2026-02-16 11:39:21 -08:00
BilalG1
6f641fabe0
Merge branch 'dev' into analytics-replays-4 2026-02-16 11:30:57 -08:00
BilalG1
907a98320a
Clickhouse sync fixing (#1198)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->
2026-02-16 11:30:38 -08:00
Bilal Godil
b9e9047b2d handle analytics app disabled in event ingestion 2026-02-16 09:35:53 -08:00
Konstantin Wohlwend
6dd8fac410 Improve sign-up rule error descriptions
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
DB migrations are backwards-compatible / Check if migrations changed (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Build and Run / docker (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test With Custom Base Port / restart-dev-and-test-with-custom-base-port (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests with custom base port / setup-tests-with-custom-base-port (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
DB migrations are backwards-compatible / Test migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migrations are backwards-compatible / No migration changes (skipped) (push) Has been cancelled
2026-02-15 17:21:46 -08:00
Konstantin Wohlwend
7fc1107304 Update AGENTS.md 2026-02-13 18:34:23 -08:00
Konstantin Wohlwend
f2bf1d6113 Better null checks in token fetching logic 2026-02-13 18:09:18 -08:00
Bilal Godil
4c6a89f774 qstash dedup key 2026-02-13 14:47:27 -08:00
BilalG1
5b9cef6b13
Internal metrics fix (#1197)
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Build and Run / docker (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Mirror main branch to main-mirror-for-wdb / lint_and_build (push) Has been cancelled
Publish npm packages / publish (push) Has been cancelled
Dev Environment Test With Custom Base Port / restart-dev-and-test-with-custom-base-port (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests with custom base port / setup-tests-with-custom-base-port (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
Sync Main to Dev / sync-commits (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->
2026-02-13 14:25:07 -08:00
Konstantin Wohlwend
d3f736fc41 Add console warning for expired access token 2026-02-13 14:14:37 -08:00
Konstantin Wohlwend
8d02c042ce Reduce number of console messages from sequencer 2026-02-13 13:13:09 -08:00
BilalG1
5b149bebaa
fix clickhouse flaky tests (#1196)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->
2026-02-13 13:05:35 -08:00
Konstantin Wohlwend
331dd5d558 Add logging to poller and sequencer 2026-02-13 12:58:29 -08:00
Konstantin Wohlwend
03ff4c0c71 Mute more long request paths 2026-02-13 12:23:24 -08:00
Bilal Godil
7328ef2984 stripe webhook handling 2026-02-13 11:59:35 -08:00
Konstantin Wohlwend
5d0f2a3775 Increase email wait 2026-02-13 10:53:21 -08:00
Bilal Godil
fa3242e504 fix stuck replayer bug
Some checks failed
DB migrations are backwards-compatible / Check if migrations changed (push) Has been cancelled
DB migrations are backwards-compatible / Test migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migrations are backwards-compatible / No migration changes (skipped) (push) Has been cancelled
2026-02-13 10:16:40 -08:00
Bilal Godil
5868a35e6e small pr fixes 2026-02-13 09:31:36 -08:00
Bilal Godil
3d51c70654 js replays 2026-02-12 19:28:06 -08:00
BilalG1
0a1097d009
Merge branch 'dev' into analytics-replays-4 2026-02-12 17:44:36 -08:00
BilalG1
d09a180dfe
clickhouse user sync (#1159)
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
DB migrations are backwards-compatible / Check if migrations changed (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Build and Run / docker (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test With Custom Base Port / restart-dev-and-test-with-custom-base-port (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests with custom base port / setup-tests-with-custom-base-port (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
DB migrations are backwards-compatible / Test migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migrations are backwards-compatible / No migration changes (skipped) (push) Has been cancelled
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Real-time AI search with project-scoped analytics and dynamic query
execution; streaming AI responses replace the placeholder flow.
* External DB sync adds ClickHouse support: users sync, sync metadata
tracking, tenancy-aware status, and per-mapping throttling.
* AI assistant UI shows expandable tool-invocation results and streams
via the real AI pipeline.

* **Chores**
* Dashboard dependencies and workspace exclusions updated; development
OpenAI env var added; editor config flag toggled.

* **Tests**
* E2E coverage extended to validate ClickHouse user sync and analytics
queries.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: aadesh18 <110230993+aadesh18@users.noreply.github.com>
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2026-02-12 16:52:20 -08:00
BilalG1
6673e63ee7
fix payment rounding error (#1193)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved pricing accuracy by implementing proper rounding in unit
price calculations during checkout. This ensures correct cent-level
precision in purchase computations, preventing potential rounding errors
in transaction totals.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-12 16:52:07 -08:00
Bilal Godil
175ac9d1b4 fix tests 2026-02-12 15:53:36 -08:00
Bilal Godil
278a7455b7 grouped chunk event fetching 2026-02-12 15:22:01 -08:00
Bilal Godil
5e1e828c2d max session time, improved replayer testing 2026-02-12 14:39:12 -08:00
Bilal Godil
c3121766eb improve chunk fetching logic 2026-02-12 12:48:38 -08:00
Konstantin Wohlwend
621ada20a0 Better error message for expired access tokens
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Build and Run / docker (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Mirror main branch to main-mirror-for-wdb / lint_and_build (push) Has been cancelled
Publish npm packages / publish (push) Has been cancelled
Dev Environment Test With Custom Base Port / restart-dev-and-test-with-custom-base-port (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests with custom base port / setup-tests-with-custom-base-port (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
Publish Swift SDK to prerelease repo / publish (push) Has been cancelled
Sync Main to Dev / sync-commits (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2026-02-12 12:29:11 -08:00
Bilal Godil
3660f10242 Merge remote-tracking branch 'origin/dev' into analytics-replays-4 2026-02-12 11:34:40 -08:00
Bilal Godil
36ab8ffbde remove sot test 2026-02-12 11:34:31 -08:00
Bilal Godil
659c561a14 fix lint 2026-02-12 10:45:23 -08:00
Bilal Godil
6e42342ebe sessions by refresh token, disable replays by default 2026-02-12 10:37:04 -08:00
Konstantin Wohlwend
f656ee7a0e Increase email retry count to 9 2026-02-11 20:51:34 -08:00
Konstantin Wohlwend
23b2078d9e Increase email retries further 2026-02-11 20:42:51 -08:00
Konstantin Wohlwend
6107c67335 chore: update package versions 2026-02-11 19:19:06 -08:00
BilalG1
c4d6503131
Merge branch 'analytics-replays-3' into analytics-replays-4 2026-02-11 19:12:28 -08:00
BilalG1
0cd43013e6
Merge branch 'analytics-replays-2' into analytics-replays-3 2026-02-11 19:12:23 -08:00
BilalG1
f098e96384
Merge branch 'analytics-replays-1' into analytics-replays-2 2026-02-11 19:12:19 -08:00