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

Make thread id optional #378

Merged
merged 5 commits into from
Nov 8, 2021
Merged

Make thread id optional #378

merged 5 commits into from
Nov 8, 2021

Conversation

mirgee
Copy link
Contributor

@mirgee mirgee commented Nov 5, 2021

Signed-off-by: Miroslav Kovar miroslavkovar@protonmail.com

Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee requested a review from a team as a code owner November 5, 2021 11:00
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/thread-id-optional branch from d04aeaf to a4fd531 Compare November 5, 2021 12:06
@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2021

Codecov Report

Merging #378 (d04aeaf) into main (3408cf5) will increase coverage by 0.00%.
The diff coverage is 31.70%.

❗ Current head d04aeaf differs from pull request most recent head 902ba85. Consider uploading reports for the commit 902ba85 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main     #378   +/-   ##
=======================================
  Coverage   50.45%   50.46%           
=======================================
  Files         153      153           
  Lines       11954    11950    -4     
  Branches     2345     2343    -2     
=======================================
- Hits         6031     6030    -1     
+ Misses       4252     4250    -2     
+ Partials     1671     1670    -1     
Flag Coverage Δ
integration-aries-vcx 53.27% <31.70%> (+0.01%) ⬆️
unittests-agency-client 22.51% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...x/src/handlers/connection/invitee/state_machine.rs 35.45% <0.00%> (+0.11%) ⬆️
...src/handlers/connection/inviter/states/complete.rs 51.61% <0.00%> (ø)
aries_vcx/src/handlers/connection/util.rs 71.42% <ø> (ø)
aries_vcx/src/messages/a2a/mod.rs 56.74% <ø> (ø)
aries_vcx/src/messages/connection/request.rs 53.65% <0.00%> (ø)
aries_vcx/src/messages/connection/response.rs 55.35% <0.00%> (ø)
aries_vcx/src/messages/discovery/disclose.rs 40.00% <0.00%> (-7.06%) ⬇️
aries_vcx/src/messages/error.rs 14.54% <0.00%> (ø)
...es_vcx/src/messages/issuance/credential_request.rs 15.90% <0.00%> (ø)
...cx/src/messages/proof_presentation/presentation.rs 28.57% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3408cf5...902ba85. Read the comment docs.

Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/thread-id-optional branch from aadc26d to 02222cd Compare November 7, 2021 20:59
@@ -369,13 +368,13 @@ impl SmConnectionInvitee {
Ok(Self { state, ..self })
}

pub fn handle_problem_report(self, problem_report: ProblemReport) -> VcxResult<Self> {
pub fn handle_problem_report(self, _problem_report: ProblemReport) -> VcxResult<Self> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was about to say I strongly oppose not storing problem report after it's received - only to find out we didn't do it previously either and just ignored it in impl From<(InvitedState, ProblemReport)> for InitialState { :-)

So it's good that this modification pointed that out - I think we should store it, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not so sure. Maybe we can start storing it when we have a use case for it?

let new_recipient_keys = vec!(new_pairwise_info.pw_vk.clone());
Response::create()
.set_did(new_pairwise_info.pw_did.to_string())
.set_service_endpoint(new_service_endpoint)
.set_keys(new_recipient_keys, new_routing_keys)
.ask_for_ack()
.set_thread_id(&thread_id)
.set_thread_id(&request.get_thread_id())
Copy link
Contributor

Choose a reason for hiding this comment

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

Would feel safer to always copy from self.thread_id, though after verification those values should be the same (except when the verification of the message thread id is forgotten or incorrect like happened above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, self.thread_id can't be used here because it is undefined in the scenario where the inviter is creating a connection from received request (the thread id is set after the response is built). There are ways to satisfy your demand to use self.thread_id, but I don't see the upside of that.

Copy link
Contributor

@Patrik-Stas Patrik-Stas left a comment

Choose a reason for hiding this comment

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

few comments

Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
@mirgee mirgee force-pushed the refactor/thread-id-optional branch from 902ba85 to dbf8ce1 Compare November 8, 2021 12:51
@Patrik-Stas Patrik-Stas merged commit acb5b8d into main Nov 8, 2021
@Patrik-Stas Patrik-Stas deleted the refactor/thread-id-optional branch November 8, 2021 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants