fix(mobile): keep push discovery working when NIP-11 grows - #8017
Open
superkim0610 wants to merge 2 commits into
Open
superkim0610 wants to merge 2 commits into
superkim0610 wants to merge 2 commits into
Conversation
Push discovery rejected any NIP-11 document with a top-level field outside a fixed allowlist. The relay has since added read_state_snapshot (block#7572) and artifacts, so every relay now looked push-incapable and iOS never asked for notification permission or enrolled. NIP-11 is extensible; only the push descriptor needs strict validation, which stays unchanged. Signed-off-by: superkim0610 <superkim0610@gmail.com>
🔐 Codex Security Review
|
Signed-off-by: superkim0610 <superkim0610@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
iOS push never activates against current relays.
BuzzPushLeaseDescriptor.fromRelayInformationrejected any NIP-11 document with a top-level field outside a fixed allowlist. The relay always emitsartifactsand also emitsread_state_snapshot(#7572), so every push-enabled relay failed that check. Discovery treats this as "no push capability" and only logs it withdebugPrint. The app never asks for notification permission, never registers with APNs, and never enrolls or publishes a lease, so turning push on in Settings does nothing. The pending lease revocation outbox calls the same function, so it was blocked as well.NIP-11 is an extensible document. NIP-PL requires strict validation only for the
pushdescriptor. This removes the top-level allowlist and leaves descriptor validation unchanged. Unknown fields insidepushare still rejected, as covered bydescriptor rejects unknown push fields.Related issue
None found. Companion fixes for iOS push end to end:
Testing
descriptor ignores relay metadata outside pushaddsartifacts,read_state_snapshotand an invented future field. Before the fix it fails withFormatException: NIP-11 document contains unknown field artifacts, the same error a device hits. After the fix it passes.flutter test --dart-define=BUZZ_PUSH_GATEWAY_URL=https://push.example test/shared/push/passes 99 tests with 3 skipped.dart formatandflutter analyzeare clean.ghcr.io/block/buzz:main,BUZZ_PUSH_ENABLED=true). The notification permission prompt appeared and the gateway enrollment started. A stock build never prompted.buzz-review-completed