blackboxprotobuf icon indicating copy to clipboard operation
blackboxprotobuf copied to clipboard

Editor Stuck in Infinite Loop

Open nikhilcharles-ncc opened this issue 1 year ago • 0 comments

Hi! I was editing a flow using :bbpb.edit request-body, but I noticed that if an invalid edit is saved, the editor (vim in my case) is reopened without an explanation. Even after closing the editor multiple times, the editor is reopened unless the invalid change is reverted.

When I reverted the change, the log showed the following error message: Error: [14:20:43.902] Error while editing typedef: Encountered error encoding message: Field '2' not found in typedef or does not have type attribute..

I did some digging in the code and It looks like this is the spot where the infinite loop happens:

https://github.com/nccgroup/blackboxprotobuf/blob/3ca6a1417a3e0d08f3dfede0f3af4d0c3e594bfd/mitmproxy/bbpb.py#L153-L166

Perhaps a fix could be to break the loop when an exception occurs or to present the error to the user before respawning the editor.

nikhilcharles-ncc avatar Aug 01 '24 19:08 nikhilcharles-ncc