⚡ Bolt: Files.exists() I/O 낭비 및 TOCTOU 방지 - #203
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
Removes pre-read Files.exists() checks in disk-backed artifact and ledger readers, handling “file missing” cases by catching NoSuchFileException to avoid extra stat I/O and reduce TOCTOU windows.
Changes:
FileSystemArtifactStore#getPdfnow treats missing files as cache misses by catchingNoSuchFileException.ArtifactLinkLedger#loadandKpiSnapshotLedger#loadnow attemptFiles.lines(...)directly and return onNoSuchFileException.- Adds a Bolt note documenting the “single I/O then catch NoSuchFileException” pattern.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/clearfolio/viewer/artifact/FileSystemArtifactStore.java | Removes Files.exists pre-check and handles missing file via NoSuchFileException. |
| src/main/java/com/clearfolio/viewer/artifact/ArtifactLinkLedger.java | Removes Files.exists pre-check and handles missing ledger via NoSuchFileException. |
| src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.java | Removes Files.exists pre-check and handles missing ledger via NoSuchFileException. |
| .jules/bolt.md | Documents the optimization/TOCTOU-avoidance pattern. |
| src/main/java/com/clearfolio/viewer/artifact/FileSystemArtifactStore.java.orig | New backup-like copy of pre-change source (should be removed). |
| src/main/java/com/clearfolio/viewer/artifact/ArtifactLinkLedger.java.orig | New backup-like copy of pre-change source (should be removed). |
| src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.java.orig | New backup-like copy of pre-change source (should be removed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| package com.clearfolio.viewer.artifact; | ||
|
|
||
| import java.io.IOException; | ||
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; |
| package com.clearfolio.viewer.artifact; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.UncheckedIOException; | ||
| import java.nio.charset.StandardCharsets; |
| package com.clearfolio.viewer.analytics; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.UncheckedIOException; | ||
| import java.nio.charset.StandardCharsets; |
Superseded by #222.