Skip to content

FIX: Unify UniFFI welcomes pagination API#119

Merged
mubarakcoded merged 3 commits intomasterfrom
fix-uniffi-welcomes-pagination-consistency
Jan 6, 2026
Merged

FIX: Unify UniFFI welcomes pagination API#119
mubarakcoded merged 3 commits intomasterfrom
fix-uniffi-welcomes-pagination-consistency

Conversation

@mubarakcoded
Copy link
Contributor

@mubarakcoded mubarakcoded commented Jan 6, 2026

Summary by CodeRabbit

  • Refactor

    • Consolidated the pending-welcomes API into a single call that accepts optional pagination (limit and offset); the separate paginated endpoint was removed and call sites/tests updated accordingly.
  • Breaking Changes

    • Public API now requires callers to provide pagination parameters (or None/empty values) when pagination is needed; changelogs updated to reflect this change.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Walkthrough

Replaced the separate paginated function with a single get_pending_welcomes that accepts optional limit: Option<u32> and offset: Option<u32>; removed get_pending_welcomes_paginated; updated call sites, tests, storage-traits API, and changelogs accordingly; removed MAX_PENDING_WELCOMES_OFFSET.

Changes

Cohort / File(s) Summary
API: mdk-uniffi
crates/mdk-uniffi/src/lib.rs
Replaced get_pending_welcomes_paginated(...) with unified get_pending_welcomes(&self, limit: Option<u32>, offset: Option<u32>); updated internal calls to pass None/pagination as appropriate.
Storage traits
crates/mdk-storage-traits/...
WelcomeStorage::pending_welcomes() signature changed to accept Option<Pagination>; removed MAX_PENDING_WELCOMES_OFFSET constant and related validation.
Tests & Utilities
crates/mdk-uniffi/tests/...
Updated tests to call the new get_pending_welcomes(limit, offset) signature; added/imported JsonUtil in nostr-related tests.
Changelogs
crates/mdk-uniffi/CHANGELOG.md, crates/mdk-storage-traits/CHANGELOG.md
Updated breaking-change notes to reflect the signature changes and removal of the paginated API/constant.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: unifying the welcomes pagination API by consolidating get_pending_welcomes_paginated into get_pending_welcomes with optional parameters.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c37cb40 and 4951adc.

📒 Files selected for processing (1)
  • crates/mdk-storage-traits/CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Never use bare URLs in markdown files; all URLs must be properly formatted using [link text](url), <url>, or ([#123](url)) for PR/issue references

Files:

  • crates/mdk-storage-traits/CHANGELOG.md
crates/*/CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Every crate CHANGELOG entry must include a PR reference using the format ([#123](https://github.com/marmot-protocol/mdk/pull/123))

Files:

  • crates/mdk-storage-traits/CHANGELOG.md
🧠 Learnings (3)
📚 Learning: 2026-01-03T08:39:39.799Z
Learnt from: CR
Repo: marmot-protocol/mdk PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-03T08:39:39.799Z
Learning: Every change that modifies functionality must update the CHANGELOG in the affected crate

Applied to files:

  • crates/mdk-storage-traits/CHANGELOG.md
📚 Learning: 2026-01-03T08:39:39.799Z
Learnt from: CR
Repo: marmot-protocol/mdk PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-03T08:39:39.799Z
Learning: Applies to crates/*/CHANGELOG.md : Every crate CHANGELOG entry must include a PR reference using the format `([#123](https://github.com/marmot-protocol/mdk/pull/123))`

Applied to files:

  • crates/mdk-storage-traits/CHANGELOG.md
📚 Learning: 2026-01-01T15:51:58.505Z
Learnt from: dannym-arx
Repo: marmot-protocol/mdk PR: 98
File: crates/mdk-core/CHANGELOG.md:46-46
Timestamp: 2026-01-01T15:51:58.505Z
Learning: In CHANGELOG.md files, keep the GitHub issue references (e.g., #61) as-is; do not convert '#61' (with no space) into an MD heading '# 61'. The hash without a space is intentional for GitHub auto-linking. This guideline applies to all CHANGELOG.md files in the repo.

Applied to files:

  • crates/mdk-storage-traits/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test Coverage
🔇 Additional comments (1)
crates/mdk-storage-traits/CHANGELOG.md (1)

30-30: Verify PR reference in modified CHANGELOG entry.

Line 30 is marked as modified (has ~) but references PR #110, while this change is part of PR #119. Confirm whether the PR reference should be updated to #119 or if this entry was intentionally attributed to a prior PR.


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.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

✅ Coverage: 86.85% → 87.01% (+0.16%)

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

✅ Coverage: 86.85% → 87.01% (+0.16%)

Copy link
Contributor

@dannym-arx dannym-arx left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

✅ Coverage: 86.85% → 87.01% (+0.16%)

Copy link
Contributor

@jgmontoya jgmontoya left a comment

Choose a reason for hiding this comment

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

Just a question

@mubarakcoded mubarakcoded merged commit d8462bd into master Jan 6, 2026
12 checks passed
@mubarakcoded mubarakcoded deleted the fix-uniffi-welcomes-pagination-consistency branch January 6, 2026 17:11
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.

3 participants