Skip to content

Releases: netlogix/Netlogix.JsonApiOrg.Consumer

5.0.1 - Publish testing instance of ConsumerBackend to ObjectManager

16 Jan 08:55
239b25b

Choose a tag to compare

The ConsumerBackend is a singleton. Creating a new instance while testing
only works if no included relations are involved. Otherwise, the relation
gets fetched by another instance with no shared resource cache. Obviously,
the correct way is to make the testing object known to the object manager.

5.0.0 - Async endpoint discovery, configurable endpoint cache & improved Type/URI handling

15 Jan 16:20
0146fb0

Choose a tag to compare

Breaking changes

  • Endpoint discovery registration is now asynchronous:
    registerEndpointsByEndpointDiscovery() returns a PromiseInterface.
  • The Type class has been refactored (factory creation and multi-endpoint URI handling).
    Code that instantiates Type directly or manages type URIs may require changes.

New features

  • Added requestByTypeAndFilter() to perform asynchronous requests for type/filter queries.
  • Added request-scoped helpers:
    • withSparseFields() for JSON:API sparse fieldsets (fields[type]=...)
    • withHeaders() to temporarily apply additional request headers

Bug fixes

  • JSON decoding errors now throw JsonException with additional context, including the request URI and raw response body, making invalid API responses easier to diagnose.
  • Added a validation check to ensure a Type has a URI configured before building query URLs, preventing obscure runtime errors when querying misconfigured types.

Improvements

  • Endpoint discovery cache middleware is now configurable:
    • Restrict caching to specific HTTP methods
    • Control which request headers are included in the cache key
  • Improved endpoint matching logic for discovery requests.

4.4.0 - Map response error status codes to specific exception classes

15 Aug 13:50
19288fb

Choose a tag to compare

Guzzle throws generic ClientException instances for HTTP 4xx
responses and generic ServerException instances for HTTP 5xx
responses.

In some cases, the consuming application may need to handle
errors differently depending on the exact status code. For
example, responses with status code 504 ("Gateway Timeout")
often occur when a web server closes the client connection
before the application server finishes processing. In such
cases, retrying the request might succeed, especially if
the initial request primed relevant caches.

To allow for fine-grained error handling using try/catch
blocks, individual status codes are now mapped to dedicated
exception classes.

4.3.1 - Handling of no-store was flipped

11 Jul 13:02
b4c749c

Choose a tag to compare

The internal state variable of $storeResponse was calculated
correctly, but the response got stored to cache when
$storeResponse===false.

4.3.0 - Prevent in-memory storing when "Cache-Control: no-store" is used as request header

21 Feb 08:34
4e62857

Choose a tag to compare

Feature:

The request mechanism now prevents the "request cache" (as described
in the next section below) to be used at all.

Just add the HTTP request header "Cache-Control: no-store" to the
request.

Precondition 1:

There are two different caches: The request cache and the response cache.

The respones cache can utilize the response data, which allows for tagging
cache entries and hence fine grained retention calculation, so the request
cache can be used across different PHP processes and potentially across
different users.

The request cache can only utlize what's known before the request was
made. We usually use a transient memory cache for requests. This allows
a single PHP process to issue the same GET request multiple times without
needing to flush anything, because the cache content gets dropped as soon
as the PHP process is over.

Precondition 2:

Requests not only transport their URI but an array of request heraders
as well. Those request headers are meant to pass to the upstream server.
Usually, request headers are part of the response cache header, so
different request header values might cause cache misses e.g. for
basic auth.

4.2.1 - Don't throw on cache errors

02 Dec 16:02
5e4cd5e

Choose a tag to compare

What's Changed

Full Changelog: 4.2.0...4.2.1

4.2.0 - Fix PHP 8 Deprecations

31 Oct 15:36
c3243f5

Choose a tag to compare

What's Changed

Full Changelog: 4.1.0...4.2.0

Introduce parallel fetch requests

09 Jul 08:08
02eeb6b

Choose a tag to compare

  • Add multi guzzle based client
  • Introduce ConsumerBackend::requestFromUri(): PromiseInterface
  • Switch internals from ConsumerBackend to make use of requestFromUri()

4.0.1 - Adjust method signature for null uris

04 Mar 09:02
c98642f

Choose a tag to compare

What's Changed

  • fix: Adjust getUri() method signature to allow null by @paxuclus in #20

Full Changelog: 4.0.0...4.0.1

4.0.0 - Flow 8.3 Requirement

12 Feb 13:58
e372c44

Choose a tag to compare

What's Changed

Full Changelog: 3.1.4...4.0.0