aegis-bridge 2.3.9 → 2.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/transcript.js +7 -0
- package/package.json +1 -1
package/dist/transcript.js
CHANGED
|
@@ -179,12 +179,19 @@ export async function readNewEntries(filePath, fromOffset) {
|
|
|
179
179
|
finally {
|
|
180
180
|
await fd.close();
|
|
181
181
|
}
|
|
182
|
+
let foundNewline = false;
|
|
182
183
|
for (let i = scanBuf.length - 1; i >= 0; i--) {
|
|
183
184
|
if (scanBuf[i] === 0x0a) { // '\n'
|
|
184
185
|
effectiveOffset = scanStart + i + 1;
|
|
186
|
+
foundNewline = true;
|
|
185
187
|
break;
|
|
186
188
|
}
|
|
187
189
|
}
|
|
190
|
+
// Issue #579: If no newline found and we didn't scan from byte 0,
|
|
191
|
+
// fall back to offset 0 to avoid starting mid-line.
|
|
192
|
+
if (!foundNewline && scanStart > 0) {
|
|
193
|
+
effectiveOffset = 0;
|
|
194
|
+
}
|
|
188
195
|
}
|
|
189
196
|
const slicedContent = await new Promise((resolve, reject) => {
|
|
190
197
|
const chunks = [];
|