Commit Graph

2680 Commits

Author SHA1 Message Date
Konstantin Wohlwend
abc8daf9cb Tracing for email health endpoint 2026-02-03 09:25:27 -08:00
Aman Ganapathy
9002b63f7a
[Fix] Fix Various bugs on the Explore Apps Page (#1142)
### Context

There are a smattering of bugs on the explore apps page. Clicking
"Enable App" may enable the app, but the button still shows, plus it
causes unnecessary redirects while the modal is still up. This behavior
can be seen in the linked clip


https://github.com/user-attachments/assets/09b12ccf-e174-4289-91f3-4f0e73cfe7e4

### Summary of Changes

We dynamically handle the modal open state, and track the path updates.
This lets us deal with the bugs above while avoiding unnecessary
renders, allowing reopening of previously opened modals, and preventing
unnecessary redirects.
Dealing with the enable apps button issues also now allows users to
navigate to the app page from the explore apps modal.

We also add a disable button to the modal. Previously, users had to
check the options for each app in order to disable it. Now they can do
it on the modal itself, which is in line with how the "Enable App"
functionality works.

### UI Demo




https://github.com/user-attachments/assets/5bfd35c6-5d28-4f99-958a-9300533e2351
2026-02-02 17:36:26 -08:00
Aman Ganapathy
abc320b4db
[Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140)
### Context
We noticed some errors pop up on sentry related to email rendering.
These errors seem to have been triggered by the same issue, and could be
categorized as follows:

1. Sanity test mismatch, even when the errors from freestyle and vercel
sandbox were broadly similar. This occurred due to stack traces
differing in different execution environments.
2. Rendering errors from freestyle and vercel sandbox caused by the
theme not being imported/ empty theme component.

Upon investigation, this occurred because hitting save on the email
themes page with an invalid theme (ex: deleting the `export` keyword, or
renaming the `EmailTheme` component) still triggers `bundleAndExecute`
with the invalid themes. This will obviously fail and cause the errors
to be logged, however there is no cause for concern here because the
error is returned and the save is denied because an error is returned.
It's more of a matter of noisy error logs and too strict sanity test
comparisons.

Beyond that, `js-execution` is a little opaque and hard to understand,
and this can mask errors in logic.

We also noticed a new issue: manually throwing an error in the email
theme code editor, and then trying to save was actually successful. This
was because the version of `react-email/components` we were using had
faulty error handling, and fell back to client side rendering, masking
the error. This wasn't caught by our `try-catch` safeguards because it
was a render time issue that was masked. More specifically, this was
what `react-email` was doing: `Switched to client rendering because the
server rendering errored`.

### Summary of Changes

We loosen the sanity test comparison between engine execution results in
case of errors. We then refactor the `js-execution` and
`email-rendering` files to read better, and to only `captureError` when
a service is down, but not for runtime errors in the user submitted
code.

To deal with the other bug, we bumped `react-email/components` to the
latest version. However, doing so exposed a gap between real `freestyle`
and our `freestyle-mock`: with the mock, the errors that were now raised
were treated as uncaught exceptions, crashing the mock server.
Consequently, we switched to using `node` over `bun`.

We also expanded test coverage to account for different error paths. 

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
2026-02-02 17:35:51 -08:00
BilalG1
31b8d8040d
query timing route (#1146)
<!--

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**
* Added a dedicated endpoint to retrieve query timing statistics using
query identifiers.
* Query responses now include a unique query_id for tracking and
reference.

* **Improvements**
  * Query timeout validation now enforces a maximum limit of 2 minutes.
* Query response structure updated to support separate timing
information retrieval.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-02 16:07:59 -08:00
BilalG1
0f6ae49cd8
account payments tab fix (#1147) 2026-02-02 15:22:19 -08:00
Konstantin Wohlwend
0f8b23dda1 Reduce error flickering 2026-02-02 13:07:45 -08:00
Konstantin Wohlwend
ab99302257 Fix lint 2026-02-02 10:48:39 -08:00
Madison
2227f75e41 CHANGELOG.md Update with Images 2026-02-02 11:27:09 -06:00
Madison
231b49308d
[Changelog] Updates to US date format, adds images. (#1143)
<img width="509" height="858" alt="image"
src="https://github.com/user-attachments/assets/520a1a01-f13f-4e20-a3e7-9e47a777b507"
/>

Full image view support:
<img width="2345" height="924" alt="image"
src="https://github.com/user-attachments/assets/f22f7a83-fc47-4d37-a251-56f1fbb62c8f"
/>





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

* **New Features**
* Added interactive fullscreen image preview for changelog entries with
keyboard and click-to-close controls.

* **Improvements**
  * Unified changelog date format to US M/D/YY for consistent display.
* Broadened external image loading so changelog images from common hosts
display reliably.
  * Inserted image badge placeholders to enhance changelog visuals.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-02 11:21:21 -06:00
Konstantin Wohlwend
56246fcdf6 Remove Close button from CLI auth confirm 2026-02-02 01:13:24 -08:00
Konstantin Wohlwend
6856f8761e Reorder imports
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
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
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-01-31 17:07:44 -08:00
Konstantin Wohlwend
d2beaa96c1 Fix tests 2026-01-30 23:54:44 -08:00
Konstantin Wohlwend
507859e71f Upgrade PostHog 2026-01-30 23:38:06 -08:00
Konstantin Wohlwend
da209f686c Better Clickhouse errors during development 2026-01-30 22:39:17 -08:00
Konstantin Wohlwend
d36603973a Remove requirement that auth and emails must be enabled 2026-01-30 18:51:07 -08:00
Konstantin Wohlwend
57a050ef01 Run Query in Control Center 2026-01-30 17:56:10 -08:00
Konstantin Wohlwend
823733e8fb Allow certain long-running paths
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-01-30 16:40:37 -08:00
Konstantin Wohlwend
9ba141597b Domain stopgaps 2026-01-30 16:20:41 -08:00
Konstantin Wohlwend
28144334eb Fix tests 2026-01-30 16:20:01 -08:00
Konstantin Wohlwend
0bb39192f8 Improve control center query button 2026-01-30 15:36:43 -08:00
Konstantin Wohlwend
f741698971 chore: update package versions 2026-01-30 14:14:14 -08:00
BilalG1
efefa5d31b
Partial refunds frontend (#1123)
https://www.loom.com/share/bb7abfde507f40d386ee856f5ffbd506
<!--

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**
* USD-based refund system enabling partial and full refunds with
explicit USD amounts
* Per-entry refund selection with granular quantity controls in refund
dialogs
* **Bug Fixes**
* Stronger refund validation and error handling to prevent invalid or
out-of-bounds refunds
* **Tests**
  * Expanded end-to-end coverage for refund edge cases and scenarios
* **Style**
  * Improved refund dialog UI with contextual alerts and better controls

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-29 11:20:04 -08:00
Madison
b32eb9e351
[Dashboard] Introduce changelog to stack-companion (#1090)
<!--

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**
* Changelog panel now fetches and displays recent releases with rich
Markdown rendering, per-release cards, and change-type labels.
* Visual cues (badge, glow, tooltip) indicate when unseen updates are
available; last-seen state tracked for users.

* **Chores**
* Configured external changelog data source and added a backend endpoint
to serve parsed changelog entries.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-29 12:22:24 -06:00
BilalG1
7b5cf4f042
fix analytics queries (#1141)
<!--

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

* **Improvements**
* Added automatic retry with stricter result validation and clearer
error handling for query profiling to improve reliability.

* **Chores**
* CI workflows updated to use larger runner instances (upgraded runner
size across relevant jobs).

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-29 10:21:58 -08:00
Madison
1fbae4f1f9 fix docs build for analytics app 2026-01-29 11:39:40 -06:00
Konstantin Wohlwend
c35578de9f Analytics dashboard frontend
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
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
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-01-28 19:33:41 -08:00
Aman Ganapathy
4f34200db9
[Feat] Setup new route for email monitoring (#1095)
### Summary of Changes
We need a way to tell if our email service is working. So, we set up a
route that will be periodically hit by uptime kuma. This route tries to
sign up to stack auth.
Upon signing up, an verification email will be sent. We use resend to
check the inbox and return a success if the email is found.
We use resend to setup a test email domain, and we query that domain to
see if the email has been received. In test environments/dev, we use
inbucket instead. This route also requires a secret token, which can be
configured via `.env` variables.

### Necessary config changes

Note we add several new environment variables which will need to be
populated in prod.
Also, the [config settings for
resend](https://resend.com/docs/send-with-smtp) are as follows:

1. **Host:** `smtp.resend.com`
2. **Port:** `465`
3. **Username:** `resend`
4. **Password:** `<RESEND_API_KEY>`
These may need to be set up in docker to enable emails being sent out to
resend.

To set this up with uptime kuma, follow the steps below:

1. Create a new monitor
2. Set the monitor type to `HTTP(s)`
3. The URL should hit the `/health/email` endpoint.
4. Suggested request timeout is at least 120 seconds. Reading emails
from the resend inbox can take a bit of time.
5. In headers, set the header as below:
```
{
    "authorization": "Bearer <STACK_EMAIL_MONITOR_SECRET_TOKEN>"
}
```
2026-01-28 19:09:47 -08:00
Konstantin Wohlwend
78812ec535 Reduce number of token refresh events 2026-01-28 14:56:11 -08:00
promptless[bot]
9c29e12b19
docs: Document Apple Bundle IDs for native iOS/macOS app sign-in (#1139)
[Open this suggestion in Promptless to view citations and reasoning
process](https://app.gopromptless.ai/change-history/2b709902-b62c-491c-ad6d-966069ad5ea7)

Adds documentation for configuring Apple Bundle IDs in the Stack Auth
dashboard, which is required for native iOS/macOS apps using Apple Sign
In. The new "Native App Configuration" section explains that Bundle IDs
are needed in addition to the existing web OAuth setup when using the
Swift SDK's native `ASAuthorizationController` flow, and provides
step-by-step instructions for adding Bundle IDs in the Apple
authentication method modal.

### Trigger Events

<details>
<summary><a
href="2a6b17339a...c8694c7ff5">stack-auth/stack-auth
commit (dev): c8694c7 [Fix] [Feat] Update OAuth Sign-In and Get Token
Functions to Work (#1130)</a></summary>
<br>

**Promptless Research** (1 GitHub PR)

- [Reviewed
stack-auth/stack-auth#1130](https://github.com/stack-auth/stack-auth/pull/1130)

**Agent Response**

> I've completed my analysis of PR #1130 and created a documentation
suggestion.
> 
> ## Summary
> 
> **PR #1130** adds Apple Native Sign In for iOS/macOS apps, which
requires users to configure Bundle IDs in the Stack Auth dashboard (in
addition to the existing web OAuth setup with Service IDs).
> 
> ### What I found:
> - An existing suggestion already documents the Swift SDK and its OAuth
flows
> - However, the **Apple authentication provider page** didn't mention
Bundle IDs configuration for native apps
> 
> ### Documentation created:
> 
> **New suggestion: "Document Apple Bundle IDs for native iOS/macOS app
sign-in"**
> 
> I added a new "Native App Configuration (iOS/macOS)" section to the
Apple authentication page that:
> - Explains that native iOS/macOS apps using the Swift SDK require
Bundle ID configuration
> - Clarifies that this is in addition to the web OAuth setup (not a
replacement)
> - Provides step-by-step instructions for adding Bundle IDs in the
Stack Auth dashboard
> - Notes that Bundle IDs are only required for native apps, not web
applications
> 
> This complements the existing Swift SDK documentation suggestion by
covering the Apple-specific dashboard configuration that native app
developers need to complete.

</details>



---

**Help us improve Promptless** — If this suggestion missed the mark,
please [share quick
feedback](https://app.gopromptless.ai/change-history/2b709902-b62c-491c-ad6d-966069ad5ea7?openFeedback=1).

*If you want Promptless to make further changes on this PR, feel free to
leave a comment tagging Promptless (It won't show up in the user drop
down but Promptless will get it!)*

Co-authored-by: promptless[bot] <179508745+promptless[bot]@users.noreply.github.com>
Co-authored-by: Madison <madison.w.kennedy@gmail.com>
2026-01-28 15:59:27 -06:00
Konstantin Wohlwend
4c22b37fdf --no-bail for verify-data-integrity script 2026-01-28 13:53:28 -08:00
Konstantin Wohlwend
c932c493c5 Faster event migration 2026-01-28 13:23:43 -08:00
Konstantin Wohlwend
b2765cf5b5 Improve IP info validation 2026-01-28 11:40:26 -08:00
Konstantin Wohlwend
3f3717597b Remove is_wide from Clickhouse events 2026-01-28 11:34:56 -08:00
Konstantin Wohlwend
c075621074 Fix event migration 2026-01-28 11:27:18 -08:00
Konstantin Wohlwend
8fd5b13a3b TokenRefreshEventType 2026-01-28 11:18:15 -08:00
Konstantin Wohlwend
68cc0258d2 Event migration improved UX 2026-01-28 10:27:31 -08:00
Konstantin Wohlwend
3d4fc3c28a No safe limit on events migration page 2026-01-28 10:24:51 -08:00
Konstantin Wohlwend
13542cf6ff Fix event migration page 2026-01-28 10:19:53 -08:00
Konstantin Wohlwend
26340958a3 Remove progress from events migration 2026-01-28 10:08:33 -08:00
Konstantin Wohlwend
6d608212cb Install dotenv 2026-01-28 09:42:12 -08:00
BilalG1
484c3a6332
clickhouse setup (#1032) 2026-01-28 09:12:33 -08:00
Konstantin Wohlwend
4fc5ddc82d Fix lint 2026-01-28 09:08:12 -08:00
BilalG1
d3fb974c84
fix payment data integrity (#1137)
<!--

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**
* Fixed an issue where include-by-default products were not appearing in
subscription results when other products in the same product line had
only inactive subscriptions.

* **Tests**
* Added test coverage for include-by-default product behavior in
subscription scenarios with inactive subscriptions.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-28 09:01:43 -08:00
Konstantin Wohlwend
d0517ad1c1 Fix connected account warnings 2026-01-28 00:18:02 -08:00
Konstantin Wohlwend
81070bd433 Hide native Apple sign-in 2026-01-27 21:13:09 -08:00
Aman Ganapathy
c8694c7ff5
[Fix] [Feat] Update OAuth Sign-In and Get Token Functions to Work (#1130)
### Summary of Changes

Previously, on the Swift SDK, the `signInWithOAuth` function wasn't
working. In this PR, we fix it by having the `getOAuthUrl` function to
actually redirect correctly. Note that to do so, we updated the
`validRedirectUrl` check on the backend to accept app native redirects
(from our new trusted url scheme). Another thing to note is that we
added functionality to the `TokenStore` abstraction to conditionally
refresh the access token that the user is trying to fetch if it is
expired/close to expiring if possible. `getOAuthUrl` will attempt to get
a valid access token, and thus will rely on our algorithm documented in
`utilities.md`.

The specs serve as the source of truth.

We go further and implement Apple Native sign in. To do so, we have it
hit a new route on the backend and verify the `jwtToken` retrieved by
the sdk against an Apple-provided set of `jwks`. We use jose to do so,
in line with the rest of the codebase.

We take this opportunity to refactor the oauth provider route owing to
the amount of duplicated logic. Additionally, to enable the apple sign
in, users will have to update the Apple authentication method modal on
the dashboard and add accepted bundle ids. These are identifiers for
projects, and we will check the `JWT` on the backend to make sure the
audience is set to an accepted bundleId.

We also update the Apple modal to be more informative.

### Using the new Features

To use the Apple native sign in, users will have to 1) sign up with an
apple developer account, 2) set up their bundleids for their projects by
connecting them to the apple developer account, 3) update the Stack-Auth
Authentication Methods dashboard apple modal with the relevant fields.
Then, trying to sign in with apple with our Swift SDK will use the apple
native sign in.

### UI Changes

Renamed the fields in the apple modal. Added a new field for bundle ids.
See below.


https://github.com/user-attachments/assets/0e760c0e-3198-4818-ac7f-4900d7a125bb



Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
2026-01-28 02:17:27 +00:00
Konstantin Wohlwend
2a6b17339a Fix STACK-BACKEND-M7 2026-01-27 17:39:51 -08:00
Konstantin Wohlwend
43bb5fb48f Add unknown Stripe webhook type to title 2026-01-27 17:30:28 -08:00
BilalG1
e439bd0b7e
verify payment transactions integrity (#1128)
<!--

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**
* Added a comprehensive payments data-integrity verifier, Stripe payout
reconciliation, API validation helpers, and a throttled progress utility
for long-running checks.

* **Bug Fixes**
* Improved subscription/product filtering to correctly respect customer
type during verification.

* **Chores**
* Reorganized verification scripts and updated the verification
entrypoint invocation.

* **Tests**
* Enhanced test fixtures to include full product data for subscriptions.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-27 21:17:43 +00:00
Konstantin Wohlwend
6f02961ded chore: update package versions 2026-01-27 12:33:28 -08:00