whisper-money/app/Http/Middleware
Víctor Falcón cb728ce176
fix(perf): batch feature flag resolution in shared Inertia data (#500)
## What

Collapse the two Pennant feature-flag checks in
`HandleInertiaRequests::resolveFeatureFlags()` into a single
`Feature::for($user)->values([...])` call.

## Why

The `transactionAnalysis` flag added in #496 introduced a **second**
Pennant DB lookup that runs on **every** page. That pushed the account
show page from 18 → 19 queries, breaking the `performance-tests` job on
`main`:

```
Account Show: Expected at most 18 queries, but 19 were executed.
```

Batching keeps shared data at a single query regardless of how many
flags we add, so this fixes the regression without bumping the
threshold.

## Testing

- `./vendor/bin/pest --testsuite=Performance` — 25 passed
- `tests/Feature/InertiaSharedDataTest.php` — 8 passed
- Pint clean
2026-06-06 12:00:12 +02:00
..
BlockDemoAccountActions.php feat: Spanish localization (#74) 2026-02-08 11:58:08 +01:00
EnsureOnboardingComplete.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
EnsureUserIsSubscribed.php feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
HandleAppearance.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
HandleInertiaRequests.php fix(perf): batch feature flag resolution in shared Inertia data (#500) 2026-06-06 12:00:12 +02:00
SetLocale.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
SetSentryUser.php Add Sentry user context (#348) 2026-05-04 13:26:50 +01:00
WithoutSsr.php Disable SSR for dashboard routes and extract API routes (#19) 2025-12-08 19:21:48 +01:00