@@ -74,17 +74,6 @@ def _headers(self, api_key: str) -> Dict[str, str]:
7474 "paginating. Range: 1-10000."
7575 ),
7676 },
77- {
78- "id" : "use_trs" ,
79- "type" : "boolean" ,
80- "label" : "Use incremental sync (trs)" ,
81- "required" : True ,
82- "default" : True ,
83- "description" : (
84- "When enabled, add the 'trs' query param with the last-updated timestamp "
85- "to fetch only items changed since the previous run."
86- ),
87- },
8877 {
8978 "id" : "since_minutes" ,
9079 "type" : "text" ,
@@ -166,7 +155,6 @@ def _fetch_tt_data(self, provider, update) -> List[Dict]:
166155 - page_size: int (default 50)
167156 - max_pages: int safety cap (default 200)
168157 - timeout: int per-request timeout (default 60)
169- - use_trs: bool (default True, 'trs' is RFC3339 timestamp in UTC)
170158 - since_minutes: int fallback lookback (default 1440)
171159 """
172160 url , api_key = self ._get_config (provider )
@@ -178,36 +166,26 @@ def _fetch_tt_data(self, provider, update) -> List[Dict]:
178166 # safety cap to avoid runaway loops
179167 timeout = int (config .get ("timeout" , 60 ))
180168
181- use_trs_config = config .get ("use_trs" , True )
182- if isinstance (use_trs_config , str ):
183- use_trs = use_trs_config .strip ().lower () in {"true" , "1" , "yes" , "on" }
184- else :
185- use_trs = bool (use_trs_config )
186169 trs_value : str | None = None
187- if use_trs :
188- # Prefer last_updated from the update context, fallback to provider storage or lookback window
189- last_updated_str = None
190- if isinstance (update , dict ):
191- last_updated_str = update .get ("last_updated" ) or update .get (
192- "last_update"
193- )
194- # Parse if available
195- dt_from : datetime | None = None
196- if isinstance (last_updated_str , str ):
197- try :
198- # Accept ISO-8601 with/without Z
199- dt_from = datetime .fromisoformat (
200- last_updated_str .replace ("Z" , "+00:00" )
201- )
202- except Exception :
203- dt_from = None
204- if dt_from is None :
205- # Fallback: now - since_minutes
206- minutes = int (config .get ("since_minutes" , 1440 ))
207- dt_from = datetime .now (timezone .utc ) - timedelta (minutes = minutes )
208- # TT expects 'trs' as an RFC3339 timestamp in UTC with seconds precision
209- dt_from = dt_from .astimezone (timezone .utc ).replace (microsecond = 0 )
210- trs_value = dt_from .strftime ("%Y-%m-%dT%H:%M:%SZ" )
170+ # Prefer last_updated from the update context, fallback to provider storage or lookback window
171+ last_updated_str = None
172+ if isinstance (update , dict ):
173+ last_updated_str = update .get ("last_updated" ) or update .get ("last_update" )
174+ # Parse if available
175+ dt_from : datetime | None = None
176+ if isinstance (last_updated_str , str ):
177+ try :
178+ # Accept ISO-8601 with/without Z
179+ dt_from = datetime .fromisoformat (last_updated_str .replace ("Z" , "+00:00" ))
180+ except Exception :
181+ dt_from = None
182+ if dt_from is None :
183+ # Fallback: now - since_minutes
184+ minutes = int (config .get ("since_minutes" , 1440 ))
185+ dt_from = datetime .now (timezone .utc ) - timedelta (minutes = minutes )
186+ # TT expects 'trs' as an RFC3339 timestamp in UTC with seconds precision
187+ dt_from = dt_from .astimezone (timezone .utc ).replace (microsecond = 0 )
188+ trs_value = dt_from .strftime ("%Y-%m-%dT%H:%M:%SZ" )
211189
212190 # Prepare base URL components and preserve existing query params
213191 parsed = urlparse (url )
0 commit comments