Skip to content

fix(persistence): Harden Windows file moves and variant logging#1083

Merged
leumor merged 1 commit intorelease/2from
bugfix/windows-persistence-hardening-pr
Mar 3, 2026
Merged

fix(persistence): Harden Windows file moves and variant logging#1083
leumor merged 1 commit intorelease/2from
bugfix/windows-persistence-hardening-pr

Conversation

@leumor
Copy link
Collaborator

@leumor leumor commented Mar 3, 2026

Summary

  • Move node/opennet backup replacement to run after output streams close, and log explicit failures when replace fails.
  • Add bounded retry/backoff for FileUtil.moveTo(..., REPLACE_EXISTING) fallback to handle transient Windows sharing violations.
  • Improve ClientLayerPersister variant-load diagnostics with explicit file-path/context logging and unreadable-variant classification.
  • Reduce cognitive complexity in FileUtil.moveTo(File, File) by extracting atomic-move and retry helpers while preserving behavior.
  • Add focused unit tests for move retry/backoff behavior and unreadable-variant classification.

How to test

  • ./gradlew test --tests 'network.crypta.support.io.FileUtilTest'
  • ./gradlew test --tests 'network.crypta.client.async.ClientLayerPersisterTest'
  • ./gradlew test --tests 'network.crypta.node.NodeIPDetectorTest' --tests 'network.crypta.node.NodeARKInserterTest' --tests 'network.crypta.node.OpennetManagerTest'
  • ./gradlew test

Notes

  • PR base was set to release/2 per request (current branch at invocation time).
  • No user changes were reverted.

- move node/opennet backup replace after stream close and check move result
- add bounded replace-existing retry/backoff in FileUtil.moveTo()
- improve ClientLayerPersister variant-aware unreadable-file diagnostics
- add focused tests for move retry behavior and unreadable variant classification
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
52.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@leumor leumor merged commit 240b5eb into release/2 Mar 3, 2026
3 of 4 checks passed
@leumor leumor deleted the bugfix/windows-persistence-hardening-pr branch March 3, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant