Browse Source

fix(sourcemaps): Fix error for none flat file meta (#53699)

This PR fixes an error in Sentry for the datetime conversion.
Riccardo Busetti 1 year ago
parent
commit
0aea9adf47

+ 2 - 2
src/sentry/debug_files/artifact_bundle_indexing.py

@@ -52,13 +52,13 @@ class FlatFileMeta:
 
     @staticmethod
     def build_none():
-        return FlatFileMeta(id=-1, date=datetime.min)
+        return FlatFileMeta(id=-1, date=datetime.utcfromtimestamp(0))
 
     def to_string(self) -> str:
         return f"bundle_index/{self.id}/{int(self.date.timestamp() * 1000)}"
 
     def is_none(self):
-        return self.id == -1 and self.date == datetime.min
+        return self.id == -1 and self.date == datetime.utcfromtimestamp(0)
 
 
 @sentry_sdk.tracing.trace

+ 8 - 5
src/sentry/lang/native/symbolicator.py

@@ -181,11 +181,14 @@ class Symbolicator:
             "options": {"apply_source_context": apply_source_context},
         }
 
-        debug_id_index, url_index = get_bundle_index_urls(self.project, release, dist)
-        if debug_id_index:
-            json["debug_id_index"] = debug_id_index
-        if url_index:
-            json["url_index"] = url_index
+        try:
+            debug_id_index, url_index = get_bundle_index_urls(self.project, release, dist)
+            if debug_id_index:
+                json["debug_id_index"] = debug_id_index
+            if url_index:
+                json["url_index"] = url_index
+        except Exception as e:
+            sentry_sdk.capture_exception(e)
 
         if release is not None:
             json["release"] = release