An AdonisJS framework wrapper for https://github.com/danivek/json-api-serializer to have API response formatted according to the JSON API Specification (http://jsonapi.org/)
Maybe I am not understanding something, so I apologize ahead.
But it appears that JsonApi aka JsonApi/Service/JsonApiService is registered as a singleton. Which means there is only one instance of this service for the whole app. But the service singleton keeps state via pushError/jsonApiErrors. This means that there is potential for race condition and errors of one client leaking to another.
Maybe I am not understanding something, so I apologize ahead.
But it appears that
JsonApi
akaJsonApi/Service/JsonApiService
is registered as a singleton. Which means there is only one instance of this service for the whole app. But the service singleton keeps state viapushError
/jsonApiErrors
. This means that there is potential for race condition and errors of one client leaking to another.