@salesforce/lds-runtime-mobile 1.453.0 → 1.455.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.
- package/dist/main.js +442 -58
- package/dist/types/drafts/AbstractResourceRequestActionHandler.d.ts +2 -0
- package/dist/types/drafts/UiApiDraftRecordService.d.ts +4 -2
- package/dist/types/drafts/sideEffects/SideEffectStore.d.ts +1 -0
- package/dist/types/instrumentation/metrics.d.ts +54 -1
- package/package.json +33 -33
- package/sfdc/main.js +442 -58
- package/sfdc/types/drafts/AbstractResourceRequestActionHandler.d.ts +2 -0
- package/sfdc/types/drafts/UiApiDraftRecordService.d.ts +4 -2
- package/sfdc/types/drafts/sideEffects/SideEffectStore.d.ts +1 -0
- package/sfdc/types/instrumentation/metrics.d.ts +54 -1
|
@@ -88,5 +88,7 @@ export declare abstract class AbstractResourceRequestActionHandler<ResponseType>
|
|
|
88
88
|
* Overlay the sourceBody over top of the targetBody
|
|
89
89
|
*/
|
|
90
90
|
abstract mergeRequestBody<T = unknown>(targetBody: T, sourceBody: T): T;
|
|
91
|
+
private reportNetworkDuration;
|
|
92
|
+
private reportRetryAttempt;
|
|
91
93
|
}
|
|
92
94
|
export declare function isResourceRequestAction(action: DraftAction<unknown, unknown>): action is DraftAction<ResourceRequest, unknown>;
|
|
@@ -5,6 +5,7 @@ import type { RecordEffectingHandler } from './records/actionHandlers/RecordEffe
|
|
|
5
5
|
import { type DurableStore } from '@luvio/environments';
|
|
6
6
|
import type { SideEffectStore } from './sideEffects';
|
|
7
7
|
import type { DurableRecordStore } from 'src/durableStore/DurableRecordStore';
|
|
8
|
+
import { type DraftQueueSideEffectLifecycle } from '../instrumentation/metrics';
|
|
8
9
|
export interface ReferenceIdFieldInfo {
|
|
9
10
|
id: string;
|
|
10
11
|
field: FieldRepresentation;
|
|
@@ -19,9 +20,10 @@ export declare class UiApiDraftRecordService {
|
|
|
19
20
|
private recordEffectingHandlers;
|
|
20
21
|
constructor(getLuvio: () => Luvio, durableStore: DurableStore, objectInfoService: ObjectInfoService, generateId: (prefix: string) => string, sideEffectStore: SideEffectStore, durableRecordStore: DurableRecordStore);
|
|
21
22
|
registerRecordHandler(recordHandler: RecordEffectingHandler): void;
|
|
22
|
-
setSideEffectsForActions(changedActions: DraftAction<unknown, unknown>[]): Promise<Set<string>>;
|
|
23
|
+
setSideEffectsForActions(changedActions: DraftAction<unknown, unknown>[], lifecycle: DraftQueueSideEffectLifecycle): Promise<Set<string>>;
|
|
23
24
|
removeSideEffectsForAction(removedAction: DraftAction<unknown, unknown>): Promise<Set<string>>;
|
|
24
|
-
reapplyRecordSideEffects(recordKeys: Set<string
|
|
25
|
+
reapplyRecordSideEffects(recordKeys: Set<string>, lifecycle: DraftQueueSideEffectLifecycle): Promise<void>;
|
|
26
|
+
private reportSideEffectRegionDuration;
|
|
25
27
|
synthesizeId(apiName: string): Promise<string>;
|
|
26
28
|
checkDraftPrequisites(apiName: string, fields: Record<string, any>): Promise<{
|
|
27
29
|
ok: boolean;
|
|
@@ -9,6 +9,7 @@ export declare class SideEffectStore {
|
|
|
9
9
|
removeEffects(effects: SideEffect[]): Promise<void>;
|
|
10
10
|
getEffects(key: string): SideEffect[];
|
|
11
11
|
getEffectsByTag(tag: string): SideEffect[];
|
|
12
|
+
private reportOperation;
|
|
12
13
|
private initialize;
|
|
13
14
|
private addEffectToKeyMap;
|
|
14
15
|
private removeEffectFromKeyMap;
|
|
@@ -24,6 +24,59 @@ export declare function reportDraftQueueNotifyChangedListeners(eventType: string
|
|
|
24
24
|
* client-CPU-vs-durable split of per-action processing time.
|
|
25
25
|
*/
|
|
26
26
|
export declare function reportDraftQueueDurableOperation(op: string, segment: string, durationMs: number): void;
|
|
27
|
+
/**
|
|
28
|
+
* Per-unit lifecycle split for the AsyncWorkerPool(1) serial queue, emitted once when a unit settles
|
|
29
|
+
* so the two halves are a JOINED event (rather than shipping wait and depth as unrelated aggregates).
|
|
30
|
+
* Isolates WHERE the time goes:
|
|
31
|
+
* waitMs — enqueue -> work began (waiting on the serial queue before any logic runs).
|
|
32
|
+
* holdMs — work began -> work settled (the critical section's own O(N) service time).
|
|
33
|
+
* Both are additionally tagged by a depthBucket so "does per-unit cost scale with backlog depth"
|
|
34
|
+
* (the O(N^2) signature) survives aggregation. queueDepth itself is also tracked. Operational only.
|
|
35
|
+
*/
|
|
36
|
+
export declare function reportDraftQueueWorkerTiming(waitMs: number, holdMs: number, queueDepth: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Head-of-line FIFO wait for one draft (enqueue -> upload start), bucketed so the
|
|
39
|
+
* "does wait grow with backlog depth" (O(N^2)) signal is visible per handler type. Custom handler
|
|
40
|
+
* ids are normalized to one bounded tag so caller-defined values never become metric dimensions.
|
|
41
|
+
*/
|
|
42
|
+
export declare function reportDraftQueueActionQueueWait(handlerId: string, waitMs: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* End-to-end drain time for one action (first upload attempt -> completed/failed), including
|
|
45
|
+
* retry/backoff. Compare it with network-duration and retry-attempt signals to understand the
|
|
46
|
+
* non-request portion of the drain interval.
|
|
47
|
+
*/
|
|
48
|
+
export declare function reportDraftQueueActionDrainDuration(handlerId: string, durationMs: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* One full drain sweep — first action starts uploading -> queue empties. Both raw values share a
|
|
51
|
+
* bounded batch-size cohort so aggregate duration remains sliceable by the number of actions drained.
|
|
52
|
+
*/
|
|
53
|
+
export declare function reportDraftQueueDrainCycle(durationMs: number, batchSize: number): void;
|
|
54
|
+
/**
|
|
55
|
+
* Server round-trip duration for one upload. Isolates slow-network from CPU-bound
|
|
56
|
+
* quadratic work — today only a THROWN error is captured, so a slow-but-successful (or slow 4xx/5xx)
|
|
57
|
+
* response is invisible. Tags: handler type, HTTP method, and a bucketed status class ('2xx'/'4xx'/
|
|
58
|
+
* '5xx'/'0'). No URL, body, or record id.
|
|
59
|
+
*/
|
|
60
|
+
export declare function reportDraftQueueActionNetworkDuration(handlerId: string, method: string, statusBucket: string, durationMs: number): void;
|
|
61
|
+
/**
|
|
62
|
+
* Retry event count. Repeated events identify actions cycling through the drain even when the retry
|
|
63
|
+
* cap is disabled and an exact attempt number is not persisted. cappedOut marks cap exhaustion.
|
|
64
|
+
*/
|
|
65
|
+
export declare function reportDraftQueueActionRetryAttempt(handlerId: string, cappedOut: boolean): void;
|
|
66
|
+
/**
|
|
67
|
+
* SideEffectStore operation duration + map size. The incremental map sped up the by-KEY lookup but
|
|
68
|
+
* getEffectsByTag still linearly scans all effects — this measures whether that residual scan is
|
|
69
|
+
* silently quadratic during churn. op is 'add'|'remove'|'getByTag'; incremental flags the fast path;
|
|
70
|
+
* mapSize is an integer effect count. No record keys, field names, or field values.
|
|
71
|
+
*/
|
|
72
|
+
export declare function reportDraftQueueSideEffectOp(op: string, incremental: boolean, durationMs: number, mapSize: number): void;
|
|
73
|
+
export type DraftQueueSideEffectRegion = 'set' | 'reapply';
|
|
74
|
+
export type DraftQueueSideEffectLifecycle = 'enqueued' | 'removed' | 'replaced-remove' | 'replaced-set' | 'completed-replay' | 'quick-action-completed';
|
|
75
|
+
/**
|
|
76
|
+
* Broad side-effect lifecycle duration. The fixed region and lifecycle tags identify which part of
|
|
77
|
+
* serialized draft processing is slow without emitting record keys, action ids, or field data.
|
|
78
|
+
*/
|
|
79
|
+
export declare function reportDraftQueueSideEffectRegionDuration(region: DraftQueueSideEffectRegion, lifecycle: DraftQueueSideEffectLifecycle, durationMs: number): void;
|
|
27
80
|
/**
|
|
28
81
|
* Reports an exception thrown while uploading a draft action. The thrown error is
|
|
29
82
|
* otherwise swallowed by the upload handler's retry path, leaving the failure
|
|
@@ -38,7 +91,7 @@ export declare function reportDraftQueueDurableOperation(op: string, segment: st
|
|
|
38
91
|
* the action's targetId/tag or any request body/field values.
|
|
39
92
|
*/
|
|
40
93
|
export declare function reportDraftActionUploadError(error: unknown, handlerId: string, attempt: number): void;
|
|
41
|
-
export type IdempotencyKeyRotationReason = 'idempotency-error' | 'backdating-collision' | 'merge-actions' | 'generic-400-killswitch';
|
|
94
|
+
export type IdempotencyKeyRotationReason = 'idempotency-error' | 'backdating-collision' | 'merge-actions' | 'server-validation-400' | 'generic-400-killswitch';
|
|
42
95
|
/**
|
|
43
96
|
* Emits a single greppable Splunk log line (and an o11y counter) every time a draft's
|
|
44
97
|
* Idempotency-Key is rotated — i.e. replaced with a fresh uuid rather than reused on
|