This commit is contained in:
Joey Frasier (Boothe) 2026-01-30 11:55:31 +00:00 committed by GitHub
commit 206bc46a94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -84,6 +84,16 @@ function normalizeSessionKeyForDefaults(
function applySessionDefaults(host: GatewayHost, defaults?: SessionDefaultsSnapshot) {
if (!defaults?.mainSessionKey) return;
// If session was explicitly set from URL, don't override with defaults
// This ensures direct links to specific sessions work correctly
const hostWithFlag = host as GatewayHost & { sessionFromUrl?: boolean };
if (hostWithFlag.sessionFromUrl) {
// Clear the flag after first connection so future reconnects can apply defaults if needed
hostWithFlag.sessionFromUrl = false;
return;
}
const resolvedSessionKey = normalizeSessionKeyForDefaults(host.sessionKey, defaults);
const resolvedSettingsSessionKey = normalizeSessionKeyForDefaults(
host.settings.sessionKey,

View File

@ -88,6 +88,8 @@ export function applySettingsFromUrl(host: SettingsHost) {
const session = sessionRaw.trim();
if (session) {
host.sessionKey = session;
// Mark that this session was explicitly set from URL to prevent override by defaults
(host as { sessionFromUrl?: boolean }).sessionFromUrl = true;
applySettings(host, {
...host.settings,
sessionKey: session,