-
Notifications
You must be signed in to change notification settings - Fork 203
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
| 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
| 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
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
joe10832
left a comment
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.
joe10832
left a comment
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.
Description
Resolves # (issue)
How Has This Been Tested?
Due Dilligence