We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e85e6e7 commit 1a970f8Copy full SHA for 1a970f8
2 files changed
src/Partition/ReadablePartition.js
@@ -363,7 +363,7 @@ class ReadablePartition extends events.EventEmitter {
363
}
364
position -= this.readBufferLength;
365
} while (position > 0);
366
- return position;
+ return Math.max(0, position);
367
368
369
/**
src/Storage/WritableStorage.js
@@ -86,7 +86,7 @@ class WritableStorage extends ReadableStorage {
86
partition.open();
87
const tornSequenceNumber = partition.checkTornWrite();
88
if (tornSequenceNumber >= 0) {
89
- lastValidSequenceNumber = Math.min(lastValidSequenceNumber, tornSequenceNumber - 1);
+ lastValidSequenceNumber = Math.min(lastValidSequenceNumber, tornSequenceNumber);
90
91
});
92
if (lastValidSequenceNumber < Number.MAX_SAFE_INTEGER) {
0 commit comments