Skip to content

DO NOT MERGE feat: subgraph update sub ccy on each sub change#4819

Open
jterzis wants to merge 1 commit into
mainfrom
jt/add-latest-ccy-to-sub-subgraph
Open

DO NOT MERGE feat: subgraph update sub ccy on each sub change#4819
jterzis wants to merge 1 commit into
mainfrom
jt/add-latest-ccy-to-sub-subgraph

Conversation

@jterzis

@jterzis jterzis commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Description

REPLACED BY #4839

Changes

Checklist

  • Tests added where required
  • Documentation updated where applicable
  • Changes adhere to the repository's contribution guidelines

@jterzis jterzis requested review from sergekh2 and texuf as code owners January 7, 2026 00:25
@vercel

vercel Bot commented Jan 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
river-sample-app Skipped Skipped Jan 7, 2026 0:25am

@coderabbitai

coderabbitai Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Introduces cross-cutting subscription-space currency synchronization by adding a new utility function getSubscriptionSpaceCurrency and integrating it into multiple SubscriptionModule handlers and Space:SubscriptionUpdate events to fetch and conditionally persist currency values during subscription/space record updates.

Changes

Cohort / File(s) Summary
Subscription Currency Utility
packages/subgraph/src/utils.ts
New public function getSubscriptionSpaceCurrency queries subscriptions by account and entity ID to retrieve associated space address, then delegates currency resolution to getSpaceCurrency. Returns null if subscription or space not found. Includes minor logging for lookup failures.
Handler Currency Integration
packages/subgraph/src/index.ts
Multiple SubscriptionModule handlers and Space:SubscriptionUpdate updated to invoke getSubscriptionSpaceCurrency before persisting subscription/space records. Currency conditionally written to update payloads (active, nextRenewalTime, expiresAt, lastRenewalTime, totalSpent, renewalAmount) only when fetch succeeds. SubscriptionConfigured uses onConflictDoUpdate for currency persistence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • sergekh2
  • texuf
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning PR description says it was replaced by PR #4839, contradicting the actual changeset which implements subscription currency updates in the subgraph. Update description to accurately reflect the implemented changes: adding subscription currency synchronization across subgraph handlers, or mark PR as superseded if genuinely replaced.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main change: adding subscription currency updates to the subgraph on each subscription change event.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jt/add-latest-ccy-to-sub-subgraph

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jterzis jterzis changed the title feat: subgraph update sub ccy on each sub change DO NOT MERGE feat: subgraph update sub ccy on each sub change Jan 8, 2026
jterzis added a commit that referenced this pull request Jan 8, 2026
### Description

Rebases #4819 on top of
jt/update-orm-subgraph

### Changes

<!-- List the specific changes made in this PR, for example:
- Added/modified feature X
- Fixed bug in component Y
- Refactored module Z
- Updated documentation
-->

### Checklist

- [ ] Tests added where required
- [ ] Documentation updated where applicable
- [ ] Changes adhere to the repository's contribution guidelines

### Changeset

**Did you modify any published npm packages?**

- [ ] Yes → I ran `bun changeset` and described my changes (use `patch`
for most changes)
- [ ] No → This only affects `/core`, docs, CI, or private packages
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