Skip to content

Membership rings, baseline fixes, and Lightning KV store#183

Merged
spe1020 merged 14 commits intomainfrom
feature/membership-rings-and-baseline-fixes
Feb 17, 2026
Merged

Membership rings, baseline fixes, and Lightning KV store#183
spe1020 merged 14 commits intomainfrom
feature/membership-rings-and-baseline-fixes

Conversation

@spe1020
Copy link
Contributor

@spe1020 spe1020 commented Feb 17, 2026

Summary

  • Membership avatar rings: Display visual ring indicators on user avatars based on membership tier (Cook+, Pro, Founders Club)
  • Baseline type fixes: Fix various TypeScript type issues, memoization cache key bug, and grocery list error handling
  • Lightning invoice metadata → Cloudflare KV: Move in-memory Map store to GATED_CONTENT KV namespace so Strike webhooks and client polling work across Cloudflare Workers isolates (fixes intermittent Lightning membership payment failures)

Test plan

  • Verify avatar rings display correctly for each membership tier
  • Verify pnpm build passes with no type errors
  • Create a Lightning membership invoice in dev → confirm in-memory fallback works
  • Deploy to Cloudflare → create Lightning invoice → confirm KV entry written with inv: prefix → verify webhook and client polling can read metadata from any isolate

🤖 Generated with Claude Code

Copilot AI and others added 9 commits February 17, 2026 00:59
Co-authored-by: spe1020 <140115230+spe1020@users.noreply.github.com>
Co-authored-by: spe1020 <140115230+spe1020@users.noreply.github.com>
[WIP] Address feedback on membership rings and baseline type fixes
Co-authored-by: spe1020 <140115230+spe1020@users.noreply.github.com>
Co-authored-by: spe1020 <140115230+spe1020@users.noreply.github.com>
Fix missing error feedback for grocery list creation failures
In-memory store caused intermittent membership payment failures when
Strike webhooks or client polling hit a different Workers isolate.
Now uses GATED_CONTENT KV namespace with inv:/invhash: key prefixes
and 2-hour TTL. Keeps in-memory fallback for local dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@spe1020 spe1020 requested a review from Copilot February 17, 2026 17:20
@cloudflare-workers-and-pages
Copy link

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

Deploying frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 96856fc
Status: ✅  Deploy successful!
Preview URL: https://88d84a7f.frontend-hvd.pages.dev
Branch Preview URL: https://feature-membership-rings-and.frontend-hvd.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

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

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
frontend 97e73fc Feb 17 2026, 06:01 PM

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Lightning membership payment flow to persist invoice metadata in Cloudflare KV (with a dev in-memory fallback) so Strike webhooks and client verification work reliably across Cloudflare Workers isolates, alongside a few TS/runtime fixes.

Changes:

  • Migrate invoice metadata storage from in-memory Map to GATED_CONTENT Cloudflare KV (with dev fallback).
  • Update membership/genesis Lightning create/verify + Strike webhook endpoints to use the KV-backed async metadata API.
  • Minor client/runtime fixes: memoization cache key behavior and grocery store error-state handling.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/lib/invoiceMetadataStore.server.ts Replaces in-memory TTL store with KV-backed storage + dev fallback and new async APIs.
src/routes/api/membership/create-lightning-invoice/+server.ts Writes invoice metadata via KV-backed store during invoice creation.
src/routes/api/membership/verify-lightning-payment/+server.ts Reads invoice metadata via KV-backed store during client verification.
src/routes/api/membership/strike-webhook/+server.ts Reads invoice metadata via KV-backed store during Strike webhook processing.
src/routes/api/genesis/create-lightning-invoice/+server.ts Writes founders invoice metadata via KV-backed store.
src/routes/api/genesis/verify-lightning-payment/+server.ts Reads founders invoice metadata via KV-backed store for verification.
src/lib/stores/groceryStore.ts Clears error on new-list creation and surfaces save failure message into store state.
src/lib/memoization.ts Adjusts memoized reactive helper to include dependency values in memoization keying.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 17, 2026

@spe1020 I've opened a new pull request, #184, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 17, 2026

@spe1020 I've opened a new pull request, #185, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 17, 2026

@spe1020 I've opened a new pull request, #186, to work on those changes. Once the pull request is ready, I'll request review from you.

spe1020 and others added 4 commits February 17, 2026 12:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@spe1020 spe1020 merged commit 661c02a into main Feb 17, 2026
1 of 2 checks passed
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

Comments