@@ -64,6 +64,7 @@ def __init__(
6464 oauth_client_id : Optional [str ] = None ,
6565 origin_service : Optional [str ] = None ,
6666 cookie_created_timestamp : Optional [float ] = None ,
67+ loid_created_timestamp : Optional [float ] = None ,
6768 extracted_fields : Optional [dict ] = None ,
6869 ):
6970 self ._user_id = user_id
@@ -75,6 +76,7 @@ def __init__(
7576 self ._oauth_client_id = oauth_client_id
7677 self ._origin_service = origin_service
7778 self ._cookie_created_timestamp = cookie_created_timestamp
79+ self ._loid_created_timestamp = loid_created_timestamp
7880 self ._extracted_fields = extracted_fields
7981
8082 def to_dict (self ) -> Dict :
@@ -90,6 +92,7 @@ def to_dict(self) -> Dict:
9092 "oauth_client_id" : self ._oauth_client_id ,
9193 "origin_service" : self ._origin_service ,
9294 "cookie_created_timestamp" : self ._cookie_created_timestamp ,
95+ "loid_created_timestamp" : self ._loid_created_timestamp ,
9396 "other_fields" : ef ,
9497 ** ef ,
9598 }
@@ -99,6 +102,7 @@ def to_event_dict(self) -> Dict:
99102 "id" : self ._user_id ,
100103 "logged_in" : self ._logged_in ,
101104 "cookie_created_timestamp" : self ._cookie_created_timestamp ,
105+ "loid_created_timstamp" : self ._loid_created_timestamp ,
102106 "is_employee" : self ._user_is_employee ,
103107 }
104108
@@ -135,6 +139,7 @@ def to_event_dict(self) -> Dict:
135139 "device_id" : self ._device_id ,
136140 "origin_service" : self ._origin_service ,
137141 "cookie_created_timestamp" : self ._cookie_created_timestamp ,
142+ "loid_created_timestamp" : self ._loid_created_timestamp ,
138143 "user" : user_fields ,
139144 "app" : app_fields ,
140145 "geo" : geo_fields ,
@@ -1041,6 +1046,17 @@ def make_object_for_context(self, name: str, span: Span) -> Decider:
10411046 logger .info (
10421047 f"Error while accessing `user.event_fields()` in `make_object_for_context()`. details: { exc } "
10431048 )
1049+
1050+ loid_created_timestamp = None
1051+ try :
1052+ if isinstance (ec .authentication_token , ValidatedAuthenticationToken ):
1053+ loid_cms = ec .authentication_token .oauth_client_id
1054+ if oc_id :
1055+ loid_created_timestamp = loid_cms
1056+ except Exception as exc :
1057+ logger .info (
1058+ f"Unable to access `ec.authentication_token.loid_created_ms` in `make_object_for_context()`. details: { exc } "
1059+ )
10441060
10451061 oauth_client_id = None
10461062 try :
@@ -1104,6 +1120,7 @@ def make_object_for_context(self, name: str, span: Span) -> Decider:
11041120 device_id = device_id ,
11051121 oauth_client_id = oauth_client_id ,
11061122 cookie_created_timestamp = cookie_created_timestamp ,
1123+ loid_created_timestamp = loid_created_timestamp ,
11071124 extracted_fields = parsed_extracted_fields ,
11081125 )
11091126 except Exception as exc :
0 commit comments