Skip to content

checkPublishStatus

checkPublishStatus(connection, jobId, requestTimeout?, onPollError?): () => Promise<StatusResult>

Defined in: checkPublishStatus.ts:45

Builds a PollingClient-compatible poll() function for a community publish job.

BackgroundOperation.FinishedAt (populated once the job reaches a terminal state) is used as the completion signal rather than matching specific Status picklist values, since that’s a reliable signal regardless of exact status wording. Error (populated on failure) determines success vs. failure once finished.

Connection

The org connection to poll against.

string

The jobId returned by POST /connect/communities/{id}/publish.

Duration = DEFAULT_PUBLISH_REQUEST_TIMEOUT

Bounds each status-check attempt. Defaults to DEFAULT_PUBLISH_REQUEST_TIMEOUT; overridable mainly so tests don’t have to wait out the real default.

(error) => void

Called with the error whenever a status check fails, so the caller can surface it (the poll itself still reports “not finished yet”).

A poll() function for PollingClient.create({ poll, ... }).

() => Promise<StatusResult>

CommunityPublishFailedError if the job reaches a terminal failure state.