tonhowtf/omniget · warning
[player] failed saving spotify heartbeat_enabled
Error message
[player] failed saving spotify heartbeat_enabled
What it means
Non-fatal warning: persisting the new heartbeat_enabled value via study:music:spotify:settings:set failed. The in-memory flag is already applied and heartbeat start/stop proceeds regardless, but the preference may not survive restart.
Solutions
- Check the logged cause (transport vs storage)
- Verify the backend implements study:music:spotify:settings:set
- Retry the save or re-toggle the setting once the backend responds
- Surface a 'preference not saved' hint to the user if persistence keeps failing
Example fix
// before
catch (e) {
console.warn("[player] failed saving spotify heartbeat_enabled", e);
}
// after
catch (e) {
console.warn("[player] failed saving spotify heartbeat_enabled", e);
this._spotifySettingsSaveFailed = true; // re-attempt on next toggle
} Defensive patterns
Strategy: try-catch
Validate before calling
if (typeof value !== "boolean") throw new TypeError("heartbeat_enabled must be boolean"); Try / catch
try {
await pluginInvoke("study", "study:music:spotify:settings:set", { heartbeat_enabled: value });
} catch (e) {
console.warn("[player] failed saving spotify heartbeat_enabled", e);
queueSaveRetry({ heartbeat_enabled: value });
} Prevention
- Apply the in-memory change immediately, persist asynchronously
- Queue a retry when persistence fails so the preference eventually saves
- Notify the user if a preference could not be persisted
- Verify backend implements the settings:set command before release
When it happens
Trigger: pluginInvoke("study", "study:music:spotify:settings:set", { heartbeat_enabled }) rejects — backend unavailable, command missing, or storage write error.
Common situations: Study plugin not running during the toggle, backend missing the settings:set command, or read-only/full settings storage.
Related errors
- [player] failed loading spotify settings
- não achei nenhum StreamingHistory_*.json /…
- external_data_cache: plugin_id must not be empty
- external_data_cache: namespace must not be empty
- external_data_cache: plugin_id/namespace must not contain…
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/93e6514144bc5464.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/study-music/player-store.svelte.ts:754
this._spotifyHeartbeatMs = Number.isFinite(ms)
? Math.min(
MusicPlayerStore.SPOTIFY_HEARTBEAT_MAX_MS,
Math.max(MusicPlayerStore.SPOTIFY_HEARTBEAT_MIN_MS, ms),
)
: 30_000;
} catch (e) {
console.warn("[player] failed loading spotify settings", e);
}
}
async setSpotifyHeartbeatEnabled(value: boolean) {
this._spotifyHeartbeatEnabled = value;
try {
await pluginInvoke("study", "study:music:spotify:settings:set", {
heartbeat_enabled: value,
});
} catch (e) {
console.warn("[player] failed saving spotify heartbeat_enabled", e);
}
if (value && this.isSpotify() && this._spotifyIsPlaying) {
this.startSpotifyHeartbeat();
} else if (!value) {
this.stopSpotifyHeartbeat();
}
}
async setSpotifyHeartbeatIntervalMs(ms: number) {
const clamped = Math.min(
MusicPlayerStore.SPOTIFY_HEARTBEAT_MAX_MS,
Math.max(
MusicPlayerStore.SPOTIFY_HEARTBEAT_MIN_MS,
Math.floor(Number(ms) || 30_000),
),
);
this._spotifyHeartbeatMs = clamped;
try {View on GitHub (pinned to 8600b91f42)