moov-io / ach

ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/ach/
Apache License 2.0
456 stars 151 forks source link

fields in addenda99 dishonored having preceding reserved spaces are getting added to it as leading spaces #1364

Closed anujtewari closed 8 months ago

anujtewari commented 8 months ago

ACH Version

v1.34.0

What were you trying to do?

parsing ach file as json

What did you expect to see?

no leading spaces in addenda 99 dishonored fields having preceding reserved spaces

What did you see?

leading spaces in addenda 99 dishonored fields having preceding reserved spaces

How can we reproduce the problem?

parsing a dishonored returned entry to json

The bug seems to be introduced in v1.33.1 when changes to 'reduce allocation while parsing' was done. ref - https://github.com/moov-io/ach/commit/7fed124e5eb170c8e9e9e9e096f1b4f6e89dd083#diff-a2d88c6fd0967bfa55829b7b0df3cf0c7c22e4b1c8d67f8dc7adf3dbcd76c1e4

for every reserved position, the buff needs to reset so that it doesn't get added to subsequent fields

adamdecaf commented 8 months ago

Thank you for reporting this. I've opened https://github.com/moov-io/ach/pull/1365 which should fix this. Could you help verify?

anujtewari commented 8 months ago

sorry I missed reviewing. thanks a lot for the quick fix. when can we have a new release with this fix?

adamdecaf commented 8 months ago

The fix is included in https://github.com/moov-io/ach/releases/tag/v1.34.2