FeedbackRepositoryImpl

class FeedbackRepositoryImpl(apiClient: MCPFeedbackAPIClient, enricherProvider: () -> PayloadEnricher? = { runCatching { SdkContext.payloadEnricher() }.getOrNull() }) : FeedbackRepository

:sdk-networking implementation of FeedbackRepository. Calls the suspending MCPFeedbackAPIClient.submitFeedback directly — Plan 32-04 eliminated the prior suspendCancellableCoroutine bridge along with the Handler/Thread transport in APIClient.

DTO mapping rules:

  • FeedbackRequest.messageFeedbackData.title (fallback; overridable via metadata"title")

  • Optional metadata keys recognized: "title", "details", "severity", "feedback_type", "reporter_email". Unknown keys pass through in the metadata DTO field.

  • screenshotPngBytes → base64-encoded as screenshotBase64 (API expects base64).

  • FeedbackResponse.feedbackIdFeedbackReceipt.id.

Threat T-32-07: _submissions only retains receipts — never the request payload.

Constructors

Link copied to clipboard
constructor(apiClient: MCPFeedbackAPIClient, enricherProvider: () -> PayloadEnricher? = { runCatching { SdkContext.payloadEnricher() }.getOrNull() })

Functions

Link copied to clipboard
open override fun observeSubmissions(): Flow<List<FeedbackReceipt>>
Link copied to clipboard
open suspend override fun submit(request: FeedbackRequest): Result<FeedbackReceipt>