Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,8 @@ abstract class ProjectHandlerActivity : BaseEditorActivity() {
if (gradleBuildResult.isFailure) {
val error = gradleBuildResult.exceptionOrNull()
log.error("Failed to read project cache", error)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: removed error tracking: exception is no longer captured with Sentry.captureException(). cache read failures won't be tracked for monitoring

Context Used: Rule from dashboard - Use Sentry.captureException() to capture exceptions for error tracking and monitoring. (source)

if (error != null) {
Sentry.captureException(error)
}

withContext(Dispatchers.Main) { postProjectInit(false, CACHE_READ_ERROR) }
withContext(Dispatchers.Main) { initializeProject(forceSync = true) }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: infinite recursion risk: if forced sync succeeds but cache read still fails, onProjectInitialized will call initializeProject(forceSync=true) again, creating infinite loop. need retry counter or max attempts check

Suggested change
withContext(Dispatchers.Main) { initializeProject(forceSync = true) }
// Prevent infinite retry loop - only retry once
if (forceSync) {
withContext(Dispatchers.Main) { postProjectInit(false, CACHE_READ_ERROR) }
} else {
withContext(Dispatchers.Main) { initializeProject(forceSync = true) }
}

return@launch
}

Expand Down