{"record":{"id":"9b62cd251322a4da","repo":"tonhowtf/omniget","slug":"player-failed-loading-rpc-music-settings","errorCode":null,"errorMessage":"[player] failed loading rpc music_settings","messagePattern":"\\[player\\] failed loading rpc music_settings","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/study-music/player-store.svelte.ts","lineNumber":820,"sourceCode":"\n  private async loadRpcSettings() {\n    if (this._rpcSettingsLoaded) return;\n    this._rpcSettingsLoaded = true;\n    try {\n      const res = await pluginInvoke<{\n        show_cover?: boolean;\n        show_buttons?: boolean;\n        update_interval_ms?: number;\n      }>(\"study\", \"study:music:rpc:music_settings:get\", {});\n      if (typeof res?.show_cover === \"boolean\") this._rpcShowCover = res.show_cover;\n      if (typeof res?.show_buttons === \"boolean\") this._rpcShowButtons = res.show_buttons;\n      if (typeof res?.update_interval_ms === \"number\") {\n        this._rpcUpdateIntervalMs = MusicPlayerStore.clampRpcInterval(\n          res.update_interval_ms,\n        );\n      }\n    } catch (e) {\n      console.warn(\"[player] failed loading rpc music_settings\", e);\n    }\n  }\n\n  getRpcShowCover(): boolean {\n    return this._rpcShowCover;\n  }\n\n  getRpcShowButtons(): boolean {\n    return this._rpcShowButtons;\n  }\n\n  getRpcUpdateIntervalMs(): number {\n    return this._rpcUpdateIntervalMs;\n  }\n\n  async setRpcShowCover(value: boolean) {\n    this._rpcShowCover = value;\n    try {","sourceCodeStart":802,"sourceCodeEnd":838,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/study-music/player-store.svelte.ts#L802-L838","documentation":"Warning logged when loading persisted music/RPC settings from the backend fails: pluginInvoke('study', <settings:get>) threw before the store could apply heartbeat/show_cover/show_buttons/update_interval_ms values. The store keeps its defaults, so RPC settings reset for the session.","triggerScenarios":"Calling the store's settings loader (at init or after re-login) when the study plugin's settings:get command rejects — plugin missing, backend panic, or corrupted/unreadable settings payload.","commonSituations":"Fresh install where the plugin backend is not yet ready; corrupted settings file on disk; version mismatch where the command name changed.","solutions":["Verify the study plugin is initialized before the store loads settings (await backend ready event)","Inspect the caught error; if it is a missing-command error, update the frontend/backend versions to match","Delete or repair the corrupted settings file so get succeeds","Rely on defaults — the code intentionally swallows the error and continues"],"exampleFix":"// before\nawait initPlayerStore();\n// after\nawait backendReady(\"study\");\nawait initPlayerStore();","handlingStrategy":"fallback","validationCode":"null","typeGuard":"function isSettingsPayload(v: unknown): v is { heartbeat_interval_ms?: number; update_interval_ms?: number; show_cover?: boolean; show_buttons?: boolean } { return typeof v === \"object\" && v !== null; }","tryCatchPattern":"try { const res = await pluginInvoke(...); applySettings(res); } catch (e) { console.warn(\"using default rpc settings\", e); applySettings(DEFAULT_SETTINGS); }","preventionTips":["Gate store initialization on a backend-ready signal","Keep defaults identical to backend defaults so a failed load is invisible","Log the underlying cause in production, not just DEV"],"tags":["ipc","persistence","settings"],"backgroundTag":"api-request-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}