Skip to content

Commit bc3b8e3

Browse files
fix: connection reuse with multi-tenancy (openwallet-foundation#3578)
Signed-off-by: Daniel Bluhm <dbluhm@pm.me> Co-authored-by: Daniel Bluhm <dbluhm@pm.me>
1 parent a981b3f commit bc3b8e3

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

aries_cloudagent/core/profile.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,21 @@ def __repr__(self) -> str:
129129
self.__class__.__name__, self.backend, self.name
130130
)
131131

132+
def __eq__(self, other) -> bool:
133+
"""Equality checks for profiles.
134+
135+
Multiple profile instances can exist at the same time but point to the
136+
same profile. This allows us to test equality based on the profile
137+
pointed to by the instance rather than by object reference comparison.
138+
"""
139+
if not isinstance(other, Profile):
140+
return False
141+
142+
if type(self) is not type(other):
143+
return False
144+
145+
return self.name == other.name
146+
132147

133148
class ProfileManager(ABC):
134149
"""Handle provision and open for profile instances."""

aries_cloudagent/protocols/out_of_band/v1_0/routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ async def invitation_receive(request: web.BaseRequest):
329329
mediation_id=mediation_id,
330330
)
331331
except (DIDXManagerError, StorageError, BaseModelError) as err:
332+
LOGGER.exception("Error during receive invitation")
332333
raise web.HTTPBadRequest(reason=err.roll_up) from err
333334

334335
return web.json_response(result.serialize())

0 commit comments

Comments
 (0)