Skip to content

receipt-payload#10

Merged
Daniel-Ric merged 2 commits intomasterfrom
feature/2026-01-28/analyze-and-fix-empty-top-creators-response
Jan 28, 2026
Merged

receipt-payload#10
Daniel-Ric merged 2 commits intomasterfrom
feature/2026-01-28/analyze-and-fix-empty-top-creators-response

Conversation

@Daniel-Ric
Copy link
Copy Markdown
Owner

Motivation

  • Receipt parsing needed to accept additional real-world shapes such as stringified Receipt payloads, nested receipt fields, and prefixed JWTs to avoid brittle inventory creator detection.
  • The creators/top aggregation needed to account for direct creatorId/creatorID fields in entitlement entries in addition to embedded receipt parsing.

Description

  • Added and exported extractReceiptEntitlements in src/services/minecraft.service.js that normalizes receipts by stripping Bearer/JWT prefixes, decoding JWTs with {complete: true, json: true}, parsing stringified Receipt values, handling unpadded base64url payloads, and recursively unwrapping nested receipt objects.
  • Updated src/routes/inventory.routes.js to use extractReceiptEntitlements and to count direct creatorId/creatorID fields before attempting receipt decoding.
  • Adjusted imports to export and use extractReceiptEntitlements and added jsonwebtoken usage within the service only (no new dependencies beyond existing ones).
  • Added unit tests in tests/messaging.test.js covering prefixed JWTs, JWTs with a stringified Receipt payload, nested receipt strings, JSON, base64, and object receipts.

Testing

  • Ran the test suite with npm test and all automated tests passed successfully.
  • Test run summary: 14 tests, 0 failures, including the new receipt parsing test cases in tests/messaging.test.js.

Codex Task

@Daniel-Ric Daniel-Ric merged commit 1558fc6 into master Jan 28, 2026
@Daniel-Ric Daniel-Ric deleted the feature/2026-01-28/analyze-and-fix-empty-top-creators-response branch January 28, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant