gitroomhq/postiz-app · error · BadBody

'finalizePost is not implemented for this provider'

Error message

'finalizePost is not implemented for this provider'

What it means

Companion stub to checkPostStatus on SocialAbstract: finalizePost performs the mutations remaining after a pending publish is reported ready. Providers that don't need a finalize step and don't override it get this BadBody error.

Source

Thrown at libraries/nestjs-libraries/src/integrations/social.abstract.ts:200

    accessToken: string,
    pendingData: any,
    integration: Integration
  ): Promise<PendingCheckResponse> {
    throw new BadBody(
      this.identifier,
      '{}',
      '{}',
      'checkPostStatus is not implemented for this provider'
    );
  }

  /** Runs the mutations left after `checkPostStatus` returns `ready`. Same contract as `checkPostStatus`. */
  public async finalizePost(
    accessToken: string,
    pendingData: any,
    integration: Integration
  ): Promise<PendingCheckResponse> {
    throw new BadBody(
      this.identifier,
      '{}',
      '{}',
      'finalizePost is not implemented for this provider'
    );
  }

  // axios flavor of the SSRF-safe dispatcher that `this.fetch` applies - for
  // providers that need axios (form-data / stream uploads). Never call plain
  // axios with a user-influenced URL.
  protected getSsrfSafeAxios() {
    return getSsrfSafeAxios();
  }

  protected assetBoolean(value: boolean | string) {
    if (typeof value === 'string') {
      return value.toLowerCase() === 'true';
    }

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Override finalizePost in the provider's integration class and return a PendingCheckResponse (e.g. { state: 'success', data: pendingData })
  2. If finalize is a no-op for the provider, implement it to pass through the pendingData unchanged
  3. Ensure the provider's checkPostStatus never returns 'ready' if finalization is unsupported

Example fix

// before
class FooProvider extends SocialAbstract {
  // no finalizePost
}
// after
class FooProvider extends SocialAbstract {
  public async finalizePost(accessToken: string, pendingData: any, integration: Integration): Promise<PendingCheckResponse> {
    // provider-specific final mutations here
    return { state: 'success', data: pendingData };
  }
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (provider.finalizePost === SocialAbstract.prototype.finalizePost) {
  // no finalize step needed; don't call it
}

Type guard

const supportsFinalize = (p: SocialAbstract): boolean =>
  p.finalizePost !== SocialAbstract.prototype.finalizePost;

Try / catch

try {
  await provider.finalizePost(token, pendingData, integration);
} catch (e) {
  if (/finalizePost is not implemented/.test(String(e?.message ?? e))) {
    // finalize is a no-op for this provider; continue
  } else throw e;
}

Prevention

When it happens

Trigger: The publish workflow calling finalizePost after checkPostStatus returned ready, on a provider class that did not override finalizePost.

Common situations: See trigger scenarios.

Related errors


AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27). Data as JSON: /api/errors/fd0b512bb6ceb73b. Report an issue: GitHub.