Repository navigation
Feature: Flush cipherChannel before persisting lastModifed - #209
Conversation
WalkthroughThe modifications primarily address an issue with the Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/main/java/org/cryptomator/cryptofs/ch/CleartextFileChannel.java (3 hunks)
- src/test/java/org/cryptomator/cryptofs/ch/CleartextFileChannelTest.java (2 hunks)
Additional comments: 5
src/main/java/org/cryptomator/cryptofs/ch/CleartextFileChannel.java (3)
- 3-3: The addition of
com.google.common.annotations.VisibleForTestingimport is appropriate for the change in visibility ofpersistLastModifiedto facilitate testing.- 249-250: Changing the visibility of
persistLastModifiedto@VisibleForTestingis a good practice to indicate that the method's visibility is increased for testing purposes.- 327-327: The explicit call to
ciphertextFileChannel.force(true)beforepersistLastModifiedensures that any pending changes are flushed to disk before updating thelastModifiedtimestamp, aligning with the PR's objective.src/test/java/org/cryptomator/cryptofs/ch/CleartextFileChannelTest.java (2)
- 54-56: The addition of
import static org.mockito.Mockito.inOrder;andimport static org.mockito.Mockito.spy;is necessary for the new test methodtestCloseFlushBeforePersistto verify the order of method calls.- 245-254: The new test method
testCloseFlushBeforePersistcorrectly verifies thatforce(true)onciphertextFileChannelis called beforepersistLastModified, ensuring the intended order of operations during channel closure. This aligns with the changes made inCleartextFileChannel.java.
Fixes #205.
See also #205 (comment).
Summary by CodeRabbit