Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughcreate_key_package_for_event now returns Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/mdk-uniffi/CHANGELOG.md (1)
30-45:⚠️ Potential issue | 🟠 MajorAdd the required PR link to the new Unreleased entries.
Each new entry needs the PR link in the mandated format at the end; it currently only references the issue.
Proposed fix
- **`create_key_package_for_event` No Longer Adds Protected Tag**: The `create_key_package_for_event()` function no longer adds the NIP-70 protected tag by default. This is a behavioral change - existing code that relied on the protected tag being present will now produce key packages without it. Key packages can now be republished by third parties to any relay. For users who need the protected tag, use the new `create_key_package_for_event_with_options()` function with `protected: true`. (Related: [`#168`](https://github.com/marmot-protocol/mdk/issues/168)) + **`create_key_package_for_event` No Longer Adds Protected Tag**: The `create_key_package_for_event()` function no longer adds the NIP-70 protected tag by default. This is a behavioral change - existing code that relied on the protected tag being present will now produce key packages without it. Key packages can now be republished by third parties to any relay. For users who need the protected tag, use the new `create_key_package_for_event_with_options()` function with `protected: true`. (Related: [`#168`](https://github.com/marmot-protocol/mdk/issues/168)) ([`#173`](https://github.com/marmot-protocol/mdk/pull/173)) @@ - **`create_key_package_for_event_with_options`**: New function that allows specifying whether to include the NIP-70 protected tag. Use this if you need to publish to relays that accept protected events. (Related: [`#168`](https://github.com/marmot-protocol/mdk/issues/168)) + **`create_key_package_for_event_with_options`**: New function that allows specifying whether to include the NIP-70 protected tag. Use this if you need to publish to relays that accept protected events. (Related: [`#168`](https://github.com/marmot-protocol/mdk/issues/168)) ([`#173`](https://github.com/marmot-protocol/mdk/pull/173))As per coding guidelines, "Always include a link to the PR at the end of each CHANGELOG entry using the format
([#123](https://github.com/marmot-protocol/mdk/pull/123)), using the PR number not the issue number".crates/mdk-core/src/key_packages.rs (1)
98-161:⚠️ Potential issue | 🟡 MinorUse
.to_string()for string conversion instead of.into().The code uses
"encoding".into()which violates the repo's string-conversion rule. Use.to_string()or.to_owned()instead.Fix
- TagKind::Custom("encoding".into()), + TagKind::Custom("encoding".to_string()),
🤖 Fix all issues with AI agents
In `@crates/mdk-core/CHANGELOG.md`:
- Around line 26-35: Update the Unreleased CHANGELOG entries to append the PR
link in the required format after the existing issue link for each bullet: for
the entries referencing create_key_package_for_event and
create_key_package_for_event_with_options, add the PR reference formatted like
([`#123`](https://github.com/marmot-protocol/mdk/pull/123)) using the actual PR
number (e.g., `#173`) so each bullet ends with both the issue and PR links.
1eced65 to
c634cc4
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/mdk-core/src/key_packages.rs`:
- Around line 157-161: Replace the implicit conversion using .into() with an
explicit .to_string() for the string literal passed to TagKind::Custom so the
calls like TagKind::Custom("encoding".into()) become
TagKind::Custom("encoding".to_string()); locate these occurrences in the Tag
construction sites (e.g. where tags.push(Tag::custom(TagKind::Custom(...),
[encoding.as_tag_value()])), and update the other similar TagKind::Custom(...)
uses in the file to use .to_string() instead of .into().
dannym-arx
left a comment
There was a problem hiding this comment.
Great, looks good to me!
c634cc4 to
5d88b84
Compare
❌ Coverage: 90.99% → 90.95% (-0.04%) |
…age creation for increased relay compatibility
5d88b84 to
2a9edfb
Compare
❌ Coverage: 90.99% → 90.95% (-0.04%) |
Addresses #168
This PR makes the NIP-70 "protected" tag optional when creating Nostr MLS key-package events to improve relay compatibility, defaulting to omitting the protected tag while providing an options-based API so callers can opt into it. It updates mdk-core internals and public API, adapts examples and tests, and exposes the options in UniFFI so external callers can request the protected tag when needed.
What changed:
Security impact:
Protocol changes:
API surface:
Testing: