debug: add middleware-level mobile cookie logging
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
This commit is contained in:
parent
b1045276d5
commit
c94827abcd
@ -49,8 +49,8 @@ def get_or_create_analytics_session():
|
||||
'cookie_names': list(request.cookies.keys()),
|
||||
'session_key': analytics_session_id[:8],
|
||||
}) + '\n')
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as _e:
|
||||
logger.error(f"PWA debug write failed: {_e}")
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
|
||||
@ -85,6 +85,12 @@ def register_middleware(app):
|
||||
return
|
||||
|
||||
try:
|
||||
# DEBUG: middleware-level mobile cookie check
|
||||
_ua = request.headers.get('User-Agent', '').lower()
|
||||
if 'mobile' in _ua:
|
||||
with open('/tmp/pwa_debug.log', 'a') as _mf:
|
||||
_mf.write(f"MIDDLEWARE: path={request.path} pwa_mode={request.cookies.get('pwa_mode')} pwa_display={request.cookies.get('pwa_display')}\n")
|
||||
|
||||
from utils.analytics import (
|
||||
track_page_view_for_request,
|
||||
set_current_page_view_id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user