debug: log mobile cookies earlier in analytics flow
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
164b9c925e
commit
b1045276d5
@ -36,6 +36,22 @@ def get_or_create_analytics_session():
|
||||
analytics_session_id = str(uuid.uuid4())
|
||||
session['analytics_session_id'] = analytics_session_id
|
||||
|
||||
# DEBUG: log every mobile request cookies
|
||||
ua_str = request.headers.get('User-Agent', '').lower()
|
||||
if 'mobile' in ua_str or 'android' in ua_str:
|
||||
try:
|
||||
with open('/tmp/pwa_debug.log', 'a') as _f:
|
||||
import json as _json
|
||||
_f.write(_json.dumps({
|
||||
'path': request.path,
|
||||
'pwa_mode': request.cookies.get('pwa_mode'),
|
||||
'pwa_display': request.cookies.get('pwa_display'),
|
||||
'cookie_names': list(request.cookies.keys()),
|
||||
'session_key': analytics_session_id[:8],
|
||||
}) + '\n')
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
user_session = db.query(UserSession).filter_by(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user