Skip to content

Comments

fix: Legacy app detection via referer header in SSR#744

Closed
thostetler wants to merge 0 commit intoadsabs:masterfrom
thostetler:legacy-app-detection-ssr-fix
Closed

fix: Legacy app detection via referer header in SSR#744
thostetler wants to merge 0 commit intoadsabs:masterfrom
thostetler:legacy-app-detection-ssr-fix

Conversation

@thostetler
Copy link
Member

@thostetler thostetler commented Dec 22, 2025

Legacy app detection middleware wasn't working because session changes in middleware weren't visible to GSSP

  • Check referer header directly in SSR instead of relying on middleware session flag
  • Remove middleware and session flag overhead
  • Consolidate logic into shared utility function

-- Basically it didn't work inside the middleware, since the session isn't initialized until downstream, so I moved it to ssr-utils for now

Added another commit to add back in the TRACING_HEADERS and to slightly improve the logging in the middleware

@thostetler thostetler marked this pull request as ready for review December 22, 2025 18:54
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 89.01961% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.4%. Comparing base (950ee95) to head (8ed72b4).

Files with missing lines Patch % Lines
src/utils/logging.ts 63.3% 18 Missing ⚠️
src/middleware.ts 93.4% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #744     +/-   ##
========================================
+ Coverage    72.3%   72.4%   +0.1%     
========================================
  Files         221     222      +1     
  Lines       24801   24928    +127     
  Branches     1463    1477     +14     
========================================
+ Hits        17929   18028     +99     
- Misses       6831    6859     +28     
  Partials       41      41             
Files with missing lines Coverage Δ
src/middlewares/initSession.ts 91.4% <100.0%> (+0.8%) ⬆️
src/ssr-utils.ts 68.1% <100.0%> (+0.3%) ⬆️
src/utils/legacyAppDetection.ts 100.0% <100.0%> (ø)
src/middleware.ts 93.9% <93.4%> (-0.8%) ⬇️
src/utils/logging.ts 63.3% <63.3%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thostetler thostetler force-pushed the legacy-app-detection-ssr-fix branch 2 times, most recently from 94d4a6a to 8ed72b4 Compare January 5, 2026 20:39
@thostetler thostetler closed this Jan 7, 2026
@thostetler thostetler force-pushed the legacy-app-detection-ssr-fix branch from 8ed72b4 to 9678f94 Compare January 7, 2026 17:10
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.

1 participant