Skip to content

chore: adds digestId to client responses#8283

Open
zone-live wants to merge 7 commits intomainfrom
TSA-add-digestId-to-client-response
Open

chore: adds digestId to client responses#8283
zone-live wants to merge 7 commits intomainfrom
TSA-add-digestId-to-client-response

Conversation

@zone-live
Copy link
Contributor

@zone-live zone-live commented Mar 24, 2026

Explanation

The /asset-summary and /market-overview API endpoints always return responses wrapped in an { id, digest } / { id, report } envelope where id is a unique UUID identifying the digest. This PR updates AiDigestService to require that envelope shape (removing the bare-response fallback path), extracts id and exposes it as digestId on both MarketInsightsReport and MarketOverview, and makes digestId a required field on both types. This enables downstream consumers like MM app to include a digest_id property in analytics events.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Introduces a breaking change to AiDigestService/types by rejecting non-enveloped API responses and making digestId required, which can impact downstream consumers expecting the old response shape.

Overview
Adds a required digestId to AI digest client results. MarketInsightsReport and MarketOverview now require digestId, sourced from the API envelope id.

Tightens AiDigestService response handling. The service now only accepts enveloped responses ({ id, digest } for /asset-summary and { id, report } for /market-overview), normalizes them by merging digestId into the returned object, and treats missing/invalid envelopes as API_INVALID_RESPONSE.

Tests and the package changelog are updated to reflect the new envelope requirement and digestId extraction behavior.

Written by Cursor Bugbot for commit a226186. This will update automatically on new commits. Configure here.

@zone-live zone-live requested review from a team as code owners March 24, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant