syncthing/lib/events
Antony Male 7ef2743964 lib/events: Introduce per-subscription event IDs (fixes #3335)
Events API consumers rely on being able to detect that events were skipped
by the fact that the event ID has increased by more than 1. This is
documented, and is absolutely necessary when trying to maintain a local
model of Syncthing's state.

With the introduction of LocalChangeDetected, which is not exposed to the
Events API, this contract was broken.

This commit introduces separate concepts of a "Global ID" and a
"Subscription ID". The Global ID of an event is unique across all
subscriptions. The Subscription ID is local to a particular subscription,
and always increments by 1. They are both exposed over the Events API, but
the Subscription ID uses the key "id" for backwards compatibility, and
the "?since=xx" parameter refers to the Subscription ID (making the Global
ID for information only).

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3351
LGTM: calmh
2016-06-27 21:18:58 +00:00
..
debug.go Implement facility based logger, debugging via REST API 2015-10-03 18:09:53 +02:00
events_test.go lib/events: Introduce per-subscription event IDs (fixes #3335) 2016-06-27 21:18:58 +00:00
events.go lib/events: Introduce per-subscription event IDs (fixes #3335) 2016-06-27 21:18:58 +00:00