Skip to content

Synced data.json changes from another device are overwritten #357

Closed

Description

@chhoumann

Problem. PodNotes does not implement Plugin.onExternalSettingsChange, and it rewrites the whole data.json about every 5 seconds during playback. When Obsidian Sync, iCloud or another sync tool updates data.json from another device, the next local save overwrites it, so progress, played state, feeds and playlists from the other device are lost.

A related case: the player's save-on-hide listens on the main window's document (src/ui/PodcastView/EpisodePlayer.svelte:414), so a player in a popout window may skip its save.

Approach. QuickAdd has solved this class of problem. It does a three-way merge against the last loaded or saved snapshot, merging keyed collections by identity, and implements onExternalSettingsChange. It also schedules saves on the main window and ignores reads that land after unload. The relevant QuickAdd commits are chhoumann/quickadd@d418f01f, @46753e48, @40dd5b4f and @0142db3d.

Acceptance. Reproduced with two vault instances sharing a data.json. After the fix, changes from both sides survive, and an end-to-end test covers external changes.

Found by the PodNotes codebase audit and journey inventory. The overwrite is inferred from code; not yet reproduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions