Skip to content

Commit

Permalink
Add static_profile_id to tracker_payload source config
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
atompie committed Jan 6, 2025
1 parent b2a9920 commit e60fb25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tracardi/service/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e60fb25

Please sign in to comment.