go-search-replace icon indicating copy to clipboard operation
go-search-replace copied to clipboard

Correctly handle lengths of serialized strings

Open mjangda opened this issue 11 months ago • 0 comments

This introduces an alternate approach to handling serialized strings.

Previously, we were running a search-replace per line and then attempting to fix the lengths of any serialized strings we found. This could be problematic in various contexts including when the serialized string contains an closing string delimiter (see #33).

In this PR, we handle each serialized string chunk separately by extracting the string based on the serialized string length and then running search-replace within that chunk, updating the length, and then replacing in place.

The approach is slower but addresses several bugs and edge cases.

Next:

  • [ ] Clean up the PR (remove debug statements)
  • [ ] Handle edge cases like out-of-boundary errors
  • [ ] Test, benchmark, and share the changes
  • [ ] Package and ship

mjangda avatar Mar 07 '24 06:03 mjangda