fix(pres_mgmt): sync remote config on all deep-link entry pages
Root cause of the presenter QR not propagating to other browsers/incognito: sync_config__event_pres_mgmt() was only called from pres_mgmt/+page.svelte and session/[session_id]/+page.svelte. A browser landing directly on the presenter page (e.g. via a presenter's sign-in link) never synced remote config into pres_mgmt_loc.current at all — every always-synced and lock-synced field (QR enables, POC visibility, code visibility, labels, etc.) silently stayed at hardcoded local defaults regardless of what was set on the Config page, since that page was never visited in that browser. Added the same sync $effect (mirroring the existing pattern/comment already in session/[session_id]/+page.svelte) to: - presenter/[presenter_id]/+page.svelte - locations/+page.svelte - location/[event_location_id]/+page.svelte - reports/+page.svelte Logged in PROJECT__AE_Events_PressMgmt_Config_Cleanup.md with a note that any future pres_mgmt entry page needs the same block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -247,6 +247,18 @@ Safe and backward compatible — old DB records fall through to `?? false` defau
|
||||
`presenter_page_menu.svelte`'s QR toggle was gated to `administrator_access`, hiding it from
|
||||
plain Trusted onsite staff entirely. Both now use the canonical pattern from
|
||||
`session_page_menu.svelte`: `trusted_access && !show__*_qr`.
|
||||
- [x] **Missing `sync_config__event_pres_mgmt()` calls on deep-link entry pages (2026-06-16)**
|
||||
— root cause of the presenter QR bug above: a browser landing directly on the presenter
|
||||
page (e.g. via a presenter sign-in link) never synced remote config into
|
||||
`pres_mgmt_loc.current` at all, since only `pres_mgmt/+page.svelte` and
|
||||
`session/[session_id]/+page.svelte` called the sync function. Every "always synced" and
|
||||
"lock-synced" field (QR enables, POC visibility, code visibility, labels, etc.) silently
|
||||
stayed at hardcoded local defaults on that browser regardless of admin Config page
|
||||
settings. Added the same sync `$effect` (mirroring the existing comment/pattern in
|
||||
`session/[session_id]/+page.svelte`) to `presenter/[presenter_id]/+page.svelte`,
|
||||
`locations/+page.svelte`, `location/[event_location_id]/+page.svelte`, and
|
||||
`reports/+page.svelte`. Any new pres_mgmt page that can be a first-load entry point
|
||||
(i.e. not always reached via `/pres_mgmt` or `/session/[id]` first) needs this same block.
|
||||
|
||||
### Step 6 scope (mechanical find-replace)
|
||||
|
||||
|
||||
@@ -87,6 +87,23 @@ let lq__event_obj = $derived(
|
||||
})
|
||||
);
|
||||
|
||||
// Sync server-side pres_mgmt config into local PersistedState.
|
||||
// WHY: this page can be reached directly without first visiting the pres_mgmt
|
||||
// overview or a session page — the only other places this sync runs. Without
|
||||
// it, pres_mgmt_loc.current keeps stale defaults for the session list rendered
|
||||
// below (e.g. hide__session_poc, show__session_li_poc_field).
|
||||
$effect(() => {
|
||||
const remote_cfg = $lq__event_obj?.mod_pres_mgmt_json;
|
||||
if (remote_cfg) {
|
||||
untrack(() => {
|
||||
events_func.sync_config__event_pres_mgmt({
|
||||
pres_mgmt_cfg_remote: remote_cfg,
|
||||
log_lvl: 0
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let lq__event_location_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
if (!ae_acct?.slct.event_location_id) return null;
|
||||
|
||||
@@ -74,6 +74,23 @@ let lq__event_obj = $derived(
|
||||
})
|
||||
);
|
||||
|
||||
// Sync server-side pres_mgmt config into local PersistedState.
|
||||
// WHY: this page can be reached directly without first visiting the pres_mgmt
|
||||
// overview or a session page — the only other places this sync runs. Without
|
||||
// it, pres_mgmt_loc.current keeps stale defaults (e.g. hide__session_poc,
|
||||
// show__session_li_poc_field) for the session lists rendered on this page.
|
||||
$effect(() => {
|
||||
const remote_cfg = $lq__event_obj?.mod_pres_mgmt_json;
|
||||
if (remote_cfg) {
|
||||
untrack(() => {
|
||||
events_func.sync_config__event_pres_mgmt({
|
||||
pres_mgmt_cfg_remote: remote_cfg,
|
||||
log_lvl: 0
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let lq__event_location_obj_li = $derived(
|
||||
liveQuery(async () => {
|
||||
if (!ae_acct?.slct.event_id) return [];
|
||||
|
||||
@@ -88,6 +88,25 @@ let lq__event_obj = $derived(
|
||||
return results;
|
||||
})
|
||||
);
|
||||
|
||||
// Sync server-side pres_mgmt config into local PersistedState.
|
||||
// WHY: this page is often reached directly by URL (e.g. a presenter's sign-in
|
||||
// link) without first visiting the pres_mgmt overview or a session page —
|
||||
// the only other places this sync runs. Without it, pres_mgmt_loc.current
|
||||
// keeps stale defaults (e.g. show__presenter_qr=false) even after the admin
|
||||
// has enabled a feature globally via the Config page.
|
||||
$effect(() => {
|
||||
const remote_cfg = $lq__event_obj?.mod_pres_mgmt_json;
|
||||
if (remote_cfg) {
|
||||
untrack(() => {
|
||||
events_func.sync_config__event_pres_mgmt({
|
||||
pres_mgmt_cfg_remote: remote_cfg,
|
||||
log_lvl: 0
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let lq__event_presenter_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
let results = await db_events.presenter.get(
|
||||
|
||||
@@ -78,6 +78,22 @@ let lq__event_obj = $derived(
|
||||
})
|
||||
);
|
||||
|
||||
// Sync server-side pres_mgmt config into local PersistedState.
|
||||
// WHY: this page can be reached directly without first visiting the pres_mgmt
|
||||
// overview or a session page — the only other places this sync runs. Without
|
||||
// it, pres_mgmt_loc.current keeps stale defaults for report display flags.
|
||||
$effect(() => {
|
||||
const remote_cfg = $lq__event_obj?.mod_pres_mgmt_json;
|
||||
if (remote_cfg) {
|
||||
untrack(() => {
|
||||
events_func.sync_config__event_pres_mgmt({
|
||||
pres_mgmt_cfg_remote: remote_cfg,
|
||||
log_lvl: 0
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// It is important that these not be set to a value! It messes with the Dexie LiveQuery.
|
||||
// let event_file_id_li: Array<string> = $state();
|
||||
// let event_session_id_li: Array<string> = $state();
|
||||
|
||||
Reference in New Issue
Block a user