Skip to content

Commit f29e3aa

Browse files
ctiddC Tidd
authored andcommitted
fix(amazonq): Skip including deleted files for FeatureDev context. (aws#5228)
Co-authored-by: C Tidd <[email protected]>
1 parent 13396b0 commit f29e3aa

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Amazon Q /dev: Fix issue when files are deleted while preparing context"
4+
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/FeatureDevSessionContext.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,12 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
203203

204204
createTemporaryZipFileAsync { zipOutput ->
205205
filesToIncludeFlow.collect { file ->
206-
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
207-
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
206+
try {
207+
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
208+
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
209+
} catch (e: NoSuchFileException) {
210+
// Noop: Skip if file was deleted
211+
}
208212
}
209213
}
210214
}.toFile()

0 commit comments

Comments
 (0)