Skip to content
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Fix infinite loop when workspace indexing server fails to initialize"
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@
logger.info { "project context index starting" }
delay(300)
val isIndexSuccess = index()
if (isIndexSuccess) isIndexComplete.set(true)
if (isIndexSuccess) {
isIndexComplete.set(true)

Check warning on line 120 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt#L120

Added line #L120 was not covered by tests
}
return
}
retryCount.incrementAndGet()

Check warning on line 124 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt#L124

Added line #L124 was not covered by tests
} catch (e: Exception) {
logger.warn(e) { "failed to init project context" }

Check warning on line 126 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt#L126

Added line #L126 was not covered by tests
if (e.stackTraceToString().contains("Connection refused")) {
retryCount.incrementAndGet()
delay(10000)
Expand All @@ -133,6 +137,7 @@
private suspend fun initEncryption(): Boolean {
val request = encoderServer.getEncryptionRequest()
val response = sendMsgToLsp(LspMessage.Initialize, request)
logger.info { "received response to init encryption: $response" }

Check warning on line 140 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextProvider.kt#L140

Added line #L140 was not covered by tests
return response?.responseCode == 200
}

Expand Down
Loading