Skip to content

fix(monetization): hold gifts with invalid recipients - #16

Merged
ericplane merged 1 commit into
ericplane:mainfrom
draxxptb:codex/fix-invalid-gift-recipient
Sep 24, 2026
Merged

ericplane merged 1 commit into
ericplane:mainfrom
draxxptb:codex/fix-invalid-gift-recipient

Conversation

@draxxptb

Copy link
Copy Markdown
Contributor

Summary

  • reject malformed persisted gift recipients before any paid delivery
  • keep the receipt retryable and emit a diagnostic log code instead of coercing the recipient to userId 0
  • cover the online and offline gift receipt paths with a regression test

Problem

A malformed pending gift intent without a RecipientId could reach the receipt path, where tonumber(intent.RecipientId) or 0 routed the paid gift to the DataStore key for userId 0 and returned PurchaseGranted.

Changes

  • validate persisted recipient IDs as positive, finite integers
  • return NotProcessedYet and log GIFT_INVALID_RECIPIENT when validation fails
  • declare and document the new log code
  • replace the defect characterization with a regression assertion

Validation

  • lune run lune/run-tests
  • SCRIBE_FRAGMENT_ALL=1 lune run lune/run-tests
  • SCRIBE_SPECS=gifting/GiftIntentNet lune run lune/run-tests
  • selene src test lune addons
  • positive and negative Luau type-check fixtures
  • log-code declaration/documentation check
  • clock, thread, and random seam checks
  • Stylua check on the committed Lua files

No related upstream issue.

@ericplane ericplane self-assigned this Sep 24, 2026
@ericplane ericplane added the bug Something isn't working label Sep 24, 2026
@ericplane
ericplane merged commit 8a4eafb into ericplane:main Sep 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants