Add `tenant_uuid` field to localization event

Description

inferedthe payload for localization events does not contain the teant_uuid. the tenant can usually be inferred from the header, but in the case of dird, dispatch() is only passing the payload, leading to a complete loss of the tenant info.

GIVEN a Localization event is received
WHEN I’m looking at the payload
THEN both the country and tenant_uuid fields are present

Notes
There’s two approaches that have been highlighted for this:

  1. Adding the tenant_uuid directly in the event LocalizationDict.
    Pro: Quick and straightforward
    Cons: Duplication of data (tenant_uuid both in payload and headers)
    Note: There’s already quite a lot of events that have duplicated data between the headers and payload with the idea that if it’s functional data, it should be in the payload. So, arguably, one more might not be that bad ( also considering it won’t be called that often)

  2. Overriding the dispatch() function for dird.
    Pro: We’re not duplicating data, just adding the headers back in the payload just before loosing access to said headers.
    Cons: The payload received isn’t matching the declared one. Code magic is happening, which add complexity

Zendesk Ticket IDs

None

Activity

Show:

François Blackburn March 12, 2025 at 11:50 AM

Is not the first time I see we need metadata from a message, we should consider to add a mechanism to pass raw data to the subscribed method

We can achieve it with a decorator to avoid to break all subscribed method

Done

Details

Priority

Assignee

Reporter

Approvers

Remy Bienvenu

Fix versions

Sprint

Story Points

Labels

Zendesk Support

Created March 11, 2025 at 7:34 PM
Updated April 2, 2025 at 7:30 PM
Resolved March 21, 2025 at 6:05 PM