Skip to content

Commit

Permalink
fix: connection reuse with multi-tenancy (#3543)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
  • Loading branch information
dbluhm authored Feb 26, 2025
1 parent 6b228d7 commit 3057c0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions acapy_agent/core/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ def __repr__(self) -> str:
self.__class__.__name__, self.backend, self.name
)

def __eq__(self, other) -> bool:
"""Equality checks for profiles.
Multiple profile instances can exist at the same time but point to the
same profile. This allows us to test equality based on the profile
pointed to by the instance rather than by object reference comparison.
"""
if not isinstance(other, Profile):
return False

if type(self) is not type(other):
return False

return self.name == other.name


class ProfileManager(ABC):
"""Handle provision and open for profile instances."""
Expand Down
1 change: 1 addition & 0 deletions acapy_agent/protocols/out_of_band/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ async def invitation_receive(request: web.BaseRequest):
mediation_id=mediation_id,
)
except (DIDXManagerError, StorageError, BaseModelError) as err:
LOGGER.exception("Error during receive invitation")
raise web.HTTPBadRequest(reason=err.roll_up) from err

return web.json_response(result.serialize())
Expand Down

0 comments on commit 3057c0e

Please sign in to comment.