Skip to content
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

[Pair] Present request when reparing #1040

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

alexander-lsvk
Copy link
Contributor

1.mp4

Due Dilligence

  • Breaking change
  • Requires a documentation update

@alexander-lsvk alexander-lsvk temporarily deployed to internal August 17, 2023 10:08 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk temporarily deployed to internal August 17, 2023 10:31 — with GitHub Actions Inactive
Copy link
Contributor

@llbartekll llbartekll left a comment

Choose a reason for hiding this comment

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

LGTM

guard !hasPairing(for: uri.topic) else {
throw Errors.pairingAlreadyExist(topic: uri.topic)
guard try !pairingHasPendingRequest(for: uri.topic) else {
return
Copy link
Contributor

Choose a reason for hiding this comment

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

why it's not throws anymore?

Copy link
Contributor

Choose a reason for hiding this comment

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

with throwing error we can easily test this check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will throw when try !pairingHasPendingRequest is called instead

func hasPairing(for topic: String) -> Bool {
if let pairing = pairingStorage.getPairing(forTopic: topic) {
return pairing.requestReceived
func pairingHasPendingRequest(for topic: String) throws -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need unit test for this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested in the method testPairOnSameUriPresentsRequest()

@alexander-lsvk
Copy link
Contributor Author

@flypaper0 @llbartekll the PR is on hold, need to clarify some questions

@alexander-lsvk alexander-lsvk temporarily deployed to internal September 4, 2023 11:16 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk temporarily deployed to internal September 4, 2023 11:23 — with GitHub Actions Inactive
# Conflicts:
#	Example/IntegrationTests/Pairing/PairingTests.swift
#	Example/IntegrationTests/Push/PushTests.swift
@alexander-lsvk alexander-lsvk temporarily deployed to internal September 4, 2023 11:27 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk merged commit e4556ef into develop Sep 5, 2023
@alexander-lsvk alexander-lsvk deleted the present-request-on-repairing branch September 5, 2023 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants