fix(vk): persist settings via VK Bridge storage; hide competing sign-in in Mini App hosts #278
Reference in New Issue
Block a user
Delete Branch "feature/vk-moderation-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
VK moderation follow-ups (two independent client fixes, one PR — no schema/wire change).
1. Settings lost on reload in VK desktop iframe (Firefox)
Root cause: Firefox partitions/blocks IndexedDB + localStorage in a cross-origin iframe, so the browser-local store is empty on every reload inside VK desktop. A plain tab / PWA keeps them (first-party storage); Telegram has its own CloudStorage sync. The VK identity is stable (re-derived from the signed
vk_*launch params, not from storage), so only the client prefs are lost — and the locale was additionally read back as a browser default.Fix: mirror the display prefs + coachmark flags to VK Bridge storage (
VKWebAppStorageSet/Get,lib/vkprefs.ts+lib/vk.ts), which travels over postMessage to vk.com and is immune to browser-storage partitioning; reconcile on the VK launch before first paint (reconcileVKPrefs). The locale rides this store on VK (it has no other durable client home there); it is restored via low-levelsetLocale, so it never re-pushes over the server value.2. Profile must not advertise a competing sign-in inside a host (ToS)
Inside a proprietary Mini App host (VK or Telegram) the profile now shows only email linking — both the Telegram and VK link/unlink entries are hidden (
profileValidation.signInProvidersVisible). Mirrors both ways (VK hides Telegram; Telegram hides VK). A provider linked earlier on the web stays attached, managed from the web; web/native builds are unchanged (show both).Tests
vkprefs.test.ts— codec round-trip / validation / onboarding (the wire-ish layer).profileValidation.test.ts—signInProvidersVisible(the ToS gate).svelte-check0 errors,vitest646 passed,vite buildok.vkLinkedmock account — disproportionate to build for a pure conditional render on already-tested platform predicates.Docs
ARCHITECTURE.md(VK Bridge storage sync + the profile ToS host-gate),FUNCTIONAL.md(+_ru).