Skip to content

Conversation

meekmichael
Copy link

When doing LCS diffs of very large and very different files we would keep seeing crashes when calling the prepend function. Adding this (dumb) check fixes it, it appears that when startIdx is at the end of the array, the array isn't yet large enough to accommodate this operation.

@wI2L
Copy link
Owner

wI2L commented Aug 9, 2024

Could you provide a reproducer and add a test case that demonstrate the fix please ?

@wI2L
Copy link
Owner

wI2L commented Aug 19, 2024

@meekmichael Could you share the JSON documents that trigger this case please ? I'm interested in seeing how the startIdx can be greater that the Patch slice length.

@meekmichael
Copy link
Author

The documents are company private, but I can say that they're moderately nested with large arrays of maps. I have been spending some time trying to make a reproduction case, but I still struggle. I suspect its an off-by-one error of some sort. This happens when we diff two very large docs with the same structure but largely different data. Given time I may be able to sanitize these files with random strings, but I don't have time this week.

@wI2L wI2L closed this in 5b7667c Nov 11, 2024
wI2L added a commit that referenced this pull request Nov 11, 2024
@wI2L
Copy link
Owner

wI2L commented Nov 11, 2024

@meekmichael Fixed. Will release a new tag ASAP.

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.

2 participants