-
Notifications
You must be signed in to change notification settings - Fork 17
Description
@scottinet commented on Tue Jan 23 2018
Using the request ID to check whether a notification comes from one of our own request or not is not a good idea.
Consider this use case: the SDK calls a plugin-specific API route. This API route calls internally a Kuzzle API route, using a new request object. This latter request will be the cause of a real-time notification, with its own identifier, different from the one coming from the SDK call.
Thus, upon receiving the notification, the SDK will think it does not come from one of its requests, and it will invoke the registered callback.
Instead, the SDK should create an unique identifier when instantiated, and inject it into the volatile data as a SDK source identifier.
This is a safer method, and it also is much cleaner since we won't need a request history anymore, with all the necessary code to maintain this structure up to date.