Frontmatter
| id | 9084 |
| title | Enhancement: DevRank Atomic File Persistence |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Feb 10, 2026, 3:08 PM |
| updatedAt | Feb 10, 2026, 3:12 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9084 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8930 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 10, 2026, 3:12 PM |
Enhancement: DevRank Atomic File Persistence
tobiu added parent issue #8930 on Feb 10, 2026, 3:09 PM
tobiu assigned to @tobiu on Feb 10, 2026, 3:09 PM

tobiu
Feb 10, 2026, 3:12 PM
Input from Gemini 3 Pro:
✦ I have updated
DevRank.services.Storageto use atomic file writes.Implementation: The
writeJsonmethod now follows this safe pattern:
- Writes data to a temporary file (
filename.tmp).- Renames the temporary file to the target filename (
fs.rename).This ensures that
users.jsonandtracker.jsonare never left in a corrupted or truncated state if the process crashes during a write operation. The.tmpfile is naturally cleaned up by the rename operation on success. In case of a crash, a leftover.tmpfile might remain, but the critical data file stays intact.
tobiu closed this issue on Feb 10, 2026, 3:12 PM
Implement atomic file writing in
DevRank.services.Storageto prevent data corruption during process crashes or power failures.Current State:
Storage.mjsusesfs.writeFileto directly overwrite critical data files (users.json,tracker.json). If the write operation is interrupted, the file may be left in a truncated or corrupted state.Requirement:
writeJson(or internal helper) to:filename.json.tmp).fs.renameto atomically replace the target file with the temporary file.tracker,users,visited,blacklist).Benefits: Guarantees that the data files are always valid JSON, even if the Updater crashes mid-write.