@salesforce/lds-network-fetch 1.446.0 → 1.447.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -746,10 +746,20 @@ function getStorageAndLogger(path) {
746
746
  }
747
747
  return null;
748
748
  }
749
- const platformFetchAdapter = platformNetworkAdapter(fetchNetworkAdapter);
749
+ /**
750
+ * The leaf network call for the HTTP transport.
751
+ *
752
+ * Request de-duplication (and the record dispatcher it fronts) is applied at
753
+ * the OUTER boundary of the lex pipeline in `setupLexNetworkAdapter`, not here,
754
+ * so `platformFetchAdapter` is the raw fetch adapter. Wrapping it with
755
+ * `platformNetworkAdapter` again would double-dedupe and re-run the record
756
+ * dispatcher (aggregate-ui splitting) on every attempt. See
757
+ * `networkAdapter.ts` for where dedupe sits and why.
758
+ */
759
+ const platformFetchAdapter = fetchNetworkAdapter;
750
760
  const platformFetchAdapterWithInterceptors = async (resourceRequest, resourceRequestContext, requestInterceptors, interceptorContext) => {
751
761
  const pending = runRequestInterceptors(resourceRequest, requestInterceptors, interceptorContext);
752
- return pending.then((interceptedRequest) => platformFetchAdapter(interceptedRequest, resourceRequestContext));
762
+ return pending.then((interceptedRequest) => platformFetchAdapter(interceptedRequest));
753
763
  };
754
764
  /**
755
765
  * Runs the request interceptor chain on a request and returns the intercepted
@@ -821,7 +831,7 @@ async function handleSendFetchRequest(resourceRequest, resourceRequestContext, i
821
831
  // assume one-shot invocation per logical request (tracker
822
832
  // registration, perf marks, etc.).
823
833
  const intercepted = await runRequestInterceptors(resourceRequest, requestInterceptors, context);
824
- const doFetch = (req) => platformFetchAdapter(req, resourceRequestContext);
834
+ const doFetch = (req) => platformFetchAdapter(req);
825
835
  response = retryInterceptor(intercepted, doFetch, context);
826
836
  }
827
837
  else {
@@ -845,16 +855,31 @@ async function handleSendFetchRequest(resourceRequest, resourceRequestContext, i
845
855
  });
846
856
  }
847
857
  /**
848
- * Wrapper around fetch network adapter from luvio
858
+ * Wrapper around fetch network adapter from luvio.
849
859
  *
850
- * @param requestLogger
851
- * @returns lexNetworkAdapter {@link NetworkAdapter}
860
+ * Dedupe placement: the returned pipeline is wrapped with
861
+ * `platformNetworkAdapter`, so request de-duplication (and the record
862
+ * dispatcher it fronts — aggregate-ui splitting, query-too-complicated retry)
863
+ * runs at the OUTERMOST boundary, BEFORE the durable-cache check and request
864
+ * interceptors in `handleSendFetchRequest`.
865
+ *
866
+ * This mirrors the Aura transport, where `platformNetworkAdapter` likewise wraps
867
+ * the aura adapter as the outermost layer (`salesforceNetworkAdapter(auraNetworkAdapter)`
868
+ * in lds-network-aura). Two consequences:
869
+ * 1. Concurrent identical GETs collapse to a single logical request before any
870
+ * per-caller work runs, so the dedupe transaction key is computed from the
871
+ * raw request and cannot be split by a request interceptor that injects a
872
+ * per-request-varying header/query param.
873
+ * 2. The deduped caller does NOT run its own request interceptors (tracker
874
+ * registration, perf marks). Only the first caller's per-request
875
+ * instrumentation fires — again matching the Aura transport, which already
876
+ * drops the deduped caller's middleware.
852
877
  */
853
878
  function setupLexNetworkAdapter(requestLogger, interceptors) {
854
879
  internalRequestLogger = requestLogger || internalRequestLogger;
855
- return async (resourceRequest, resourceRequestContext) => {
880
+ return platformNetworkAdapter((resourceRequest, resourceRequestContext) => {
856
881
  return handleSendFetchRequest(resourceRequest, resourceRequestContext, interceptors ?? {});
857
- };
882
+ });
858
883
  }
859
884
 
860
885
  const NO_OP = () => { };
@@ -876,4 +901,4 @@ function instrument(newInstrumentation) {
876
901
  }
877
902
 
878
903
  export { instrument, setupFetchNetworkAdapter, setupLexNetworkAdapter };
879
- // version: 1.446.0-f73bd65030
904
+ // version: 1.447.0-9045666657
@@ -11,9 +11,24 @@ export type RequestLogger = {
11
11
  */
12
12
  export declare function setupFetchNetworkAdapter(): NetworkAdapter;
13
13
  /**
14
- * Wrapper around fetch network adapter from luvio
14
+ * Wrapper around fetch network adapter from luvio.
15
+ *
16
+ * Dedupe placement: the returned pipeline is wrapped with
17
+ * `platformNetworkAdapter`, so request de-duplication (and the record
18
+ * dispatcher it fronts — aggregate-ui splitting, query-too-complicated retry)
19
+ * runs at the OUTERMOST boundary, BEFORE the durable-cache check and request
20
+ * interceptors in `handleSendFetchRequest`.
15
21
  *
16
- * @param requestLogger
17
- * @returns lexNetworkAdapter {@link NetworkAdapter}
22
+ * This mirrors the Aura transport, where `platformNetworkAdapter` likewise wraps
23
+ * the aura adapter as the outermost layer (`salesforceNetworkAdapter(auraNetworkAdapter)`
24
+ * in lds-network-aura). Two consequences:
25
+ * 1. Concurrent identical GETs collapse to a single logical request before any
26
+ * per-caller work runs, so the dedupe transaction key is computed from the
27
+ * raw request and cannot be split by a request interceptor that injects a
28
+ * per-request-varying header/query param.
29
+ * 2. The deduped caller does NOT run its own request interceptors (tracker
30
+ * registration, perf marks). Only the first caller's per-request
31
+ * instrumentation fires — again matching the Aura transport, which already
32
+ * drops the deduped caller's middleware.
18
33
  */
19
34
  export declare function setupLexNetworkAdapter(requestLogger?: RequestLogger, interceptors?: Interceptors): NetworkAdapter;
@@ -11,6 +11,16 @@ type LdsStorageConfig = {
11
11
  * @returns LdsStorageConfig if we cache that resource, otherwise null.
12
12
  */
13
13
  export declare function getStorageAndLogger(path: string): LdsStorageConfig | null;
14
+ /**
15
+ * The leaf network call for the HTTP transport.
16
+ *
17
+ * Request de-duplication (and the record dispatcher it fronts) is applied at
18
+ * the OUTER boundary of the lex pipeline in `setupLexNetworkAdapter`, not here,
19
+ * so `platformFetchAdapter` is the raw fetch adapter. Wrapping it with
20
+ * `platformNetworkAdapter` again would double-dedupe and re-run the record
21
+ * dispatcher (aggregate-ui splitting) on every attempt. See
22
+ * `networkAdapter.ts` for where dedupe sits and why.
23
+ */
14
24
  export declare const platformFetchAdapter: import("@luvio/engine").NetworkAdapter;
15
25
  export type RequestInterceptor<Context = any> = (fetchArgs: ResourceRequest, context?: Context) => PromiseLike<ResourceRequest>;
16
26
  export type ResponseInterceptor<Context = any> = (response: FetchResponse<any>, context?: Context) => PromiseLike<FetchResponse<any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-network-fetch",
3
- "version": "1.446.0",
3
+ "version": "1.447.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS Network Adapter using fetch",
6
6
  "main": "dist/ldsNetworkFetch.js",
@@ -38,7 +38,7 @@
38
38
  "@luvio/network-adapter-fetch": "0.161.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@salesforce/lds-network-aura": "^1.446.0"
41
+ "@salesforce/lds-network-aura": "^1.447.0"
42
42
  },
43
43
  "volta": {
44
44
  "extends": "../../package.json"