For DISTINCT items, if you interrupt a session and reopen another one subsequently, you can resubscribe to the item and ask for the item snapshot, which consists in a recent history.
As Lightstreamer does not persist the client state (for this heavier task we provide the
JMS Gateway), the client can only decide the length of the snapshot to request, subject to the maximum length that the Server is allowed to keep by the Metadata Adapter (see getDistinctSnapshotLength).
This recent history may fill the gap, but more likely it will be longer or shorter than the gap.
- If it is shorter, some events will be lost, but this is still consistent with the subscription "contract".
- If it is longer, the client will turn out to receive some subsequence of events twice.
This can be detected by the application, provided that it identifies the events in some way; Lightstreamer does not provide such identification.
The LSProxy interface has a simple approach.
- It assumes that the subscription is aimed at filling a static list on the screen and that the initial snapshot requested by the application, if specified through setRequestedDistinctSnapshotLength, corresponds to the size of the list.
Hence, upon internal reconnection and resubscription, it requests the same snapshot as in the original request.
- If, based on the above rule, it requests a nonempty snapshot, then it issues a special call to "onLostUpdates" to the UpdateListener to warn the application of the case (see the method documentation for details).