Skip to content

v1.5.2 — heartbeat instance lock (dual-install safety)

Choose a tag to compare

@lc4t lc4t released this 06 Jun 12:31
· 6 commits to dev since this release

Defensive hotfix for users who ended up with two Clipboard Watcher instances installed simultaneously.

The bug

If you install v1 and then v2 of the plugin via Eagle's .eagleplugin flow, Eagle does not automatically deduplicate by manifest.id. Both serviceMode instances start, both poll the clipboard, and both call eagle.item.addFromPath. Eagle internally rejects the second call as a duplicate and emits a "duplicate image" warning every time you copy an image.

What v1.5.2 does

Adds a heartbeat lock via localStorage:

  1. Each instance generates a random instanceId on load
  2. Each poll cycle writes clipboardWatcher.heartbeat = { instanceId, ts, version }
  3. Before importing, each poll reads the heartbeat. If it shows a different instanceId written less than 3 seconds ago, the instance suspends imports and surfaces this banner:

    检测到另一个 Clipboard Watcher(v{version})也在运行。请在 Eagle 插件管理中删掉旧版本,保留一个。

  4. Once you remove the older instance via Eagle → Plugins → Manage, the surviving instance's next poll sees no fresh heartbeat from anyone else and automatically resumes within 3 seconds.

Assumption: Eagle shares the localStorage origin between same-id plugin instances. If it doesn't, this mechanism degrades to a harmless no-op — each instance only ever sees its own heartbeat. The Plugin Manager cleanup remains the canonical fix in either case.

Recommended action

  1. Install v1.5.2 over your current version (settings persist).
  2. Open Eagle → Plugins → Manage Plugins and check the count.
  3. If you see two Clipboard Watcher entries, delete the older one.
  4. If you see one entry but the panel still warns about a second instance, please open an issue with the Eagle log panel output.

Full notes: docs/CHANGELOG.md