From e60fb25ce9c616f57bda0771fd7fde193ba02f6c Mon Sep 17 00:00:00 2001 From: risto Date: Mon, 6 Jan 2025 16:02:07 +0100 Subject: [PATCH] Add static_profile_id to tracker_payload source config This ensures the permanent_profile_id from tracker_payload.source is properly copied to static_profile_id in the source config. This adjustment facilitates expected behavior for GUI updates and maintains consistency in data handling. --- tracardi/service/tracker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tracardi/service/tracker.py b/tracardi/service/tracker.py index 6e3dbead..57dba1a7 100644 --- a/tracardi/service/tracker.py +++ b/tracardi/service/tracker.py @@ -32,6 +32,11 @@ def get_bridge(tracker_payload: TrackerPayload) -> Optional[ConfigurableBridge]: logger.error("Can't configure bridge. Method get_bridge used before " "EventSource was created.") + # TODO permanent_profile_id is kept in tracker_payload.source.permanent_profile_id + # TODO GUI should change it in tracker_payload.source. That is why we copy it + + tracker_payload.source.config['static_profile_id'] = tracker_payload.source.permanent_profile_id + if 'webhook' in tracker_payload.source.type: return WebHookBridge( id=tracker_payload.source.id, @@ -84,6 +89,7 @@ async def track_event(self, tracker_payload: TrackerPayload, tracking_start: flo # If there is a configurable bridge get it and set up tracker_payload and tracker_config configurable_bridge = self.get_bridge(tracker_payload) + if configurable_bridge: tracker_payload, self.tracker_config = await configurable_bridge.configure( tracker_payload,