Skip to content

Comments

Add production KV store validation to Lightning payment verification endpoints#184

Merged
spe1020 merged 3 commits intofeature/membership-rings-and-baseline-fixesfrom
copilot/sub-pr-183
Feb 17, 2026
Merged

Add production KV store validation to Lightning payment verification endpoints#184
spe1020 merged 3 commits intofeature/membership-rings-and-baseline-fixesfrom
copilot/sub-pr-183

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

The Lightning payment verification endpoints were falling back to in-memory storage when the GATED_CONTENT KV binding was missing in production, causing intermittent failures across Cloudflare Workers isolates.

Changes

  • Added explicit KV binding validation in /api/genesis/verify-lightning-payment and /api/membership/verify-lightning-payment
  • Returns 503 Service Unavailable when KV binding is absent in production environments
  • Matches existing pattern in /api/membership/strike-webhook
const kv = platform?.env?.GATED_CONTENT ?? null;
if (!kv && env.NODE_ENV === 'production') {
  return json(
    {
      error: 'Service unavailable',
      message: 'GATED_CONTENT KV namespace is not configured'
    },
    { status: 503 }
  );
}

This makes configuration errors explicit rather than silently degrading to unreliable in-memory state.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: spe1020 <140115230+spe1020@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 17, 2026

Deploying frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 202ee08
Status:⚡️  Build in progress...

View logs

Copilot AI changed the title [WIP] Update membership rings and Lightning KV store improvements Add production KV store validation to Lightning payment verification endpoints Feb 17, 2026
Copilot AI requested a review from spe1020 February 17, 2026 17:32
@spe1020 spe1020 marked this pull request as ready for review February 17, 2026 17:39
@spe1020 spe1020 merged commit c593828 into feature/membership-rings-and-baseline-fixes Feb 17, 2026
1 check was pending
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.

2 participants