-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Push] Add wc_pushPropose method #872
Conversation
…V2 into push-propose # Conflicts: # Sources/WalletConnectPush/Client/Wallet/ProtocolEngine/wc_pushSubscribe/PushSubscribeRequester.swift
restore delete subscription test
let metadata = AppMetadata(name: "GM Dapp", description: "", url: "https://gm-dapp-xi.vercel.app/", icons: []) | ||
try! await walletPushClient.subscribe(metadata: metadata, account: Account.stub(), onSign: sign) | ||
walletPushClient.subscriptionsPublisher | ||
.first() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why first
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because after calling deleteSubscription, subscriptionsPublisher will publish again with an empty array
@@ -30,8 +30,8 @@ final class MainRouter { | |||
} | |||
|
|||
func present(pushRequest: PushRequest) { | |||
PushRequestModule.create(app: app, pushRequest: pushRequest) | |||
.presentFullScreen(from: viewController, transparentBackground: true) | |||
// PushRequestModule.create(app: app, pushRequest: pushRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method unused now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to showcase w3i capabilities and limitations for dogfooding. This presents a native screen.
let protocolMethod = NotifyProposeProtocolMethod() | ||
networkingInteractor.responseErrorSubscription(on: protocolMethod) | ||
.sink { [unowned self] (payload: ResponseSubscriptionErrorPayload<NotifyProposeParams>) in | ||
kms.deletePrivateKey(for: payload.request.publicKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're removing private key, should we also unsubscribe on error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch,
btw, dapp is not supported in this version, it's mainly developed and maintained for integration testing
let subscriptionAuthWrapper = try await pushSubscribeRequester.subscribe(metadata: proposal.metadata, account: proposal.account, onSign: onSign) | ||
|
||
var pushSubscription: PushSubscription! | ||
try await withCheckedThrowingContinuation { continuation in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we do not have subscription in this point, may be we should listen subscriptionResponsePublisher separately? Not inside approve
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 hmm, like how? I kind of want to block a thread here and wait for only the first subscription
@@ -91,55 +91,40 @@ final class PushTests: XCTestCase { | |||
makeWalletClients() | |||
} | |||
|
|||
func testRequestPush() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
push request step removed from protocol right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly, the method is deprecated
Description
Resolves # (issue)
How Has This Been Tested?
Due Dilligence