:art: Enable emit event for `wallet_record`
With logging changes we can now see when emit_event is called for a record that does not have a topic defined:
e.g.
WARNING Emit event called but RECORD_TOPIC is not set for wallet_record
...
WARNING Emit event called but RECORD_TOPIC is not set for forward_route
These appear to be the only unimplemented webhook topics.
I'm not so sure about the forward_route one - presumably the warning log can just be silenced for that one? Seems to occur when OOB invites are created or received.
But for wallet_record, it may be pretty useful if an admin could subscribe on a topic to record tenants that are created, updated or deleted.
Thoughts?
Apologies - I thought the logging changes were already contributed to main, but it was just running in our fork.
It's essentially in acapy_agent.messaging.models.base_record.py::emit_event, we added:
async def emit_event(self, session: ProfileSession, payload: Optional[Any] = None):
"""Emit an event.
Args:
session: The profile session to use
payload: The event payload
"""
if not self.RECORD_TOPIC:
LOGGER.warning(
"Emit event called but RECORD_TOPIC is not set for %s",
self.RECORD_TYPE,
)
return
This change is in draft here: https://github.com/openwallet-foundation/acapy/pull/3689/files#diff-ab2bb5af01f421fe1a7e39e66a2e9e6fa2edba73d8c2f0b77e88ea064687f051
@swcurran Added more context to the above - I recall it was discussed in one of the meetings.
The forward_route warnings can probably be suppressed - not sure how informative they are - but the events for wallet_records (seems to be for creates, updates, deletes) may be useful for an admin to be able to track