Portal Community

InteractionAck Schema

FieldTypeDescription
interactionIdstringThe interaction that was completed
status"acknowledged" | "error"Whether the server processed the response successfully
processedAtISO 8601When the server finished processing
errorMessagestring (optional)Present only when status: "error" — human-readable error description

Ack Topic

The InteractionAck is published on a per-interaction ack topic: interactions.ack.{interactionId}. The client subscribes to this topic as soon as it sends the response, and unsubscribes when the ack arrives.

Client Behavior on Ack

When the ack arrives with status: "acknowledged":

When the ack arrives with status: "error":

Ack Timeout

The client waits up to 10 seconds for the ack after submitting a response. If no ack arrives within that window:

Idempotent Response Handling Design your server-side response handlers to be idempotent. In rare cases (network issues, server restarts), the same response may be delivered more than once. Use the interactionId as the idempotency key.

Full Ack Flow (Code)

// Inside InteractionResponsePublisher (simplified)
async function respond(
  interaction: InteractionRequest,
  outcome: string,
  data?: unknown
): Promise<void> {

  const response: InteractionResponse = {
    interactionId: interaction.interactionId,
    respondedBy: currentUser.id,
    outcome,
    data,
    timestamp: new Date().toISOString(),
    sessionId: edgeStreamSession.id
  };

  // Publish response to callback topic
  await edgeStreamClient.publish(
    `interactions.callback.${interaction.interactionId}`,
    response
  );

  // Wait for server ack (with 10s timeout)
  const ack = await edgeStreamClient.waitForMessage(
    `interactions.ack.${interaction.interactionId}`,
    { timeoutMs: 10_000 }
  );

  if (ack.status === 'error') {
    throw new InteractionResponseError(ack.errorMessage);
  }

  // Success — ack received
}