openwallet-foundation / acapy

ACA-Py is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://aca-py.org
Apache License 2.0
419 stars 512 forks source link

:bug: Rearrange connection record deletion after hangup #3310

Closed ff137 closed 4 weeks ago

ff137 commented 4 weeks ago

Resolves #3306

Originally, the hangup method would delete the associated connection record before posting the hangup request. This is evidently a mistake, since the hangup depends on the connection record.

Mostly it would work, since there is a delay in the deletion of the connection record reflecting in storage, but rearranging the delete after hangup is a simple fix to avoid the race condition.


Before: Sample 500 error from our tests (in "Wait for pytest and print logs" step): https://github.com/didx-xyz/aries-cloudapi-python/actions/runs/11387403475/job/31682203816

After: Our tests now pass when testing this fix: https://github.com/didx-xyz/aries-cloudapi-python/pull/1138

sonarcloud[bot] commented 4 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud