Interface: FaultyTransport
Defined in: packages/testing/src/transport.ts:106
What the engine needs from a server. Implementations must translate their own
errors into RasdError with the codes in docs/10 §1.4 so the retry classifier
can act on them.
Extends
Properties
calls
readonly calls: readonly TransportCall[];
Defined in: packages/testing/src/transport.ts:108
Every call so far, in order.
kind
readonly kind: "rsp" | "openrosa" | string & object;
Defined in: packages/sync/dist/contract.d.ts:62
Inherited from
Methods
callsTo()
callsTo(op): readonly TransportCall[];
Defined in: packages/testing/src/transport.ts:110
Calls to one operation.
Parameters
| Parameter | Type |
|---|---|
op | TransportOp |
Returns
readonly TransportCall[]
goOffline()
goOffline(): void;
Defined in: packages/testing/src/transport.ts:111
Returns
void
goOnline()
goOnline(): void;
Defined in: packages/testing/src/transport.ts:112
Returns
void
probe()?
optional probe(opts?): Promise<boolean>;
Defined in: packages/sync/dist/contract.d.ts:104
Optional: is the real server reachable right now?
navigator.onLine answers "is there a network interface", which on the
connection that matters most — hotel, office and airport wifi behind a
captive portal — is true while nothing can actually reach the API. The
engine calls this before it will push, so a portal parks the queue instead
of feeding it to a login page.
Resolve false rather than throwing for an unreachable server; throwing is
reserved for a probe that could not be attempted at all. A transport that
omits this keeps the old behaviour (trust navigator.onLine), so a
third-party transport does not break by not implementing it.
Parameters
| Parameter | Type |
|---|---|
opts? | { signal?: AbortSignal; } |
opts.signal? | AbortSignal |
Returns
Promise<boolean>
Inherited from
pullDataset()
pullDataset(name, opts): Promise<DatasetPage>;
Defined in: packages/sync/dist/contract.d.ts:78
Parameters
| Parameter | Type |
|---|---|
name | string |
opts | { signal?: AbortSignal; since?: string; } |
opts.signal? | AbortSignal |
opts.since? | string |
Returns
Promise<DatasetPage>
Inherited from
pullForms()
pullForms(opts): Promise<FormsPage>;
Defined in: packages/sync/dist/contract.d.ts:74
Parameters
| Parameter | Type |
|---|---|
opts | { signal?: AbortSignal; since?: string; } |
opts.signal? | AbortSignal |
opts.since? | string |
Returns
Promise<FormsPage>
Inherited from
pushSubmissions()
pushSubmissions(batch, opts): Promise<SubmissionAck[]>;
Defined in: packages/sync/dist/contract.d.ts:63
Parameters
| Parameter | Type |
|---|---|
batch | Submission[] |
opts | { idempotencyKey: string; signal?: AbortSignal; } |
opts.idempotencyKey | string |
opts.signal? | AbortSignal |
Returns
Promise<SubmissionAck[]>
Inherited from
registerDevice()?
optional registerDevice(info): Promise<{
policy?: Partial<SyncPolicy>;
}>;
Defined in: packages/sync/dist/contract.d.ts:83
Optional: register the device and read back server policy.
Parameters
| Parameter | Type |
|---|---|
info | { appVersion?: string; deviceId: string; platform: string; } |
info.appVersion? | string |
info.deviceId | string |
info.platform | string |
Returns
Promise<{
policy?: Partial<SyncPolicy>;
}>
Inherited from
reset()
reset(): void;
Defined in: packages/testing/src/transport.ts:114
Forget recorded calls and reset fault counters (the seed restarts too).
Returns
void
uploadAttachment()
uploadAttachment(upload, opts): Promise<{
remoteId: string;
}>;
Defined in: packages/sync/dist/contract.d.ts:68
Resumable; onProgress reports bytes sent so far for this attachment.
Parameters
| Parameter | Type |
|---|---|
upload | AttachmentUpload |
opts | { onProgress?: (sentBytes) => void; signal?: AbortSignal; } |
opts.onProgress? | (sentBytes) => void |
opts.signal? | AbortSignal |
Returns
Promise<{
remoteId: string;
}>