@@ -12,7 +12,6 @@ import kotlinx.coroutines.launch
1212import org.digma.intellij.plugin.analytics.AnalyticsService
1313import org.digma.intellij.plugin.analytics.AnalyticsServiceException
1414import org.digma.intellij.plugin.common.EDT
15- import org.digma.intellij.plugin.env.EnvironmentsSupplier
1615import org.digma.intellij.plugin.errorreporting.ErrorReporter
1716import org.digma.intellij.plugin.log.Log
1817import org.digma.intellij.plugin.model.rest.recentactivity.RecentActivityResult
@@ -85,46 +84,23 @@ class RecentActivityService(val project: Project) : Disposable {
8584 Log .log(logger::trace, project, " processRecentActivityGoToSpanRequest called with {}" , payload)
8685
8786 payload?.let {
88- EDT .ensureEDT {
89-
90- try {
91-
92- // todo: we need to show the insights only after the environment changes. but environment change is done in the background
93- // and its not easy to sync the change environment and showing the insights.
94- // this actually comes to solve the case that the recent activity and the main environment combo
95- // are not the same one and they need to sync. when this is fixed we can remove
96- // the methods EnvironmentsSupplier.setCurrent(java.lang.String, boolean, java.lang.Runnable)
97- // changing environment should be atomic and should not be effected by user activities like
98- // clicking a link in recent activity
99-
100- val spanId = payload.span.spanCodeObjectId
101- spanId?.let {
102- ScopeManager .getInstance(project).changeScope(SpanScope (spanId))
103- project.service<ActivityMonitor >().registerSpanLinkClicked(MonitoredPanel .RecentActivity )
104- }
105-
106- } catch (e: Exception ) {
107- Log .warnWithException(logger, project, e, " error in processRecentActivityGoToSpanRequest" )
108- ErrorReporter .getInstance().reportError(project, " RecentActivityService.processRecentActivityGoToSpanRequest" , e)
109- }
87+ val spanId = payload.span.spanCodeObjectId
88+ spanId?.let {
89+ ScopeManager .getInstance(project).changeScope(SpanScope (spanId))
90+ ActivityMonitor .getInstance(project).registerSpanLinkClicked(MonitoredPanel .RecentActivity )
11091 }
11192 }
11293 }
11394
11495
11596 fun processRecentActivityGoToTraceRequest (payload : RecentActivityEntrySpanForTracePayload ? ) {
11697
117- try {
118- Log .log(logger::trace, project, " processRecentActivityGoToTraceRequest called with {}" , payload)
98+ Log .log(logger::trace, project, " processRecentActivityGoToTraceRequest called with {}" , payload)
11999
120- if (payload != null ) {
121- openJaegerFromRecentActivity(project, payload.traceId, payload.span.scopeId, payload.span.spanCodeObjectId)
122- } else {
123- Log .log({ message: String? -> logger.debug(message) }, " processRecentActivityGoToTraceRequest payload is empty" )
124- }
125- } catch (e: Exception ) {
126- Log .warnWithException(logger, project, e, " error in processRecentActivityGoToTraceRequest" )
127- ErrorReporter .getInstance().reportError(project, " RecentActivityService.processRecentActivityGoToTraceRequest" , e)
100+ if (payload != null ) {
101+ openJaegerFromRecentActivity(project, payload.traceId, payload.span.scopeId, payload.span.spanCodeObjectId)
102+ } else {
103+ Log .log({ message: String? -> logger.debug(message) }, " processRecentActivityGoToTraceRequest payload is empty" )
128104 }
129105 }
130106
0 commit comments