ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.71k stars 189 forks source link

[Bug Report] Protobuf boolean field appears as number in protobuf parsed view #1479

Open jjmean2 opened 1 year ago

jjmean2 commented 1 year ago

Description

I'm not sure, if it's only for me or not, but in my case, every boolean field of protobuf message appears as number. So if the value is true, it shows as 1 (in JSON form of protobuf parsed value), and if the value is false, it is not shown entirely (because it is default value which doesn't include an actual value in packet?)

Steps to Reproduce

  1. Set Any protobuf message that has a boolean field in Protobuf Rules.
  2. Check that field value in protobuf parsed view in request or response tab.

Current Behavior

Boolean field value appears as number. (1 or nothing)

Expected Behavior

Boolean field value appears as boolean. (true or nothing)

Environment

NghiaTranUIT commented 1 year ago

Just wondering: What is the field type (described in protoc/desc file)? Is it Int or Boolean?

jjmean2 commented 1 year ago

@NghiaTranUIT

I'm not familiar with proto.desc file format, so I'm not sure if I check correctly. But when I check, I find it is 'bool'. (the value of field.type is 8)

I refer to code of following link.

to read desc file. https://gist.github.com/justinfx/c2b1458ea2ddab8faf635cacd140ad2d

to find which type has value 8. https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor#FieldDescriptor

siddarthkalra commented 1 week ago

@NghiaTranUIT any word on this bug fix or a possible workaround? I am seeing the same issue on Proxyman Version 5.10.0 (51000) | macOS: Version 14.5 (Build 23F79) when inspecting protobuf responses. In particular, this is quite limiting when trying to use the map local tool as all bools are being converted to integers.

For me bools are shown as:

"blockingInterstitials": {
    "bool_1": 0,
    "bool_2": 0
},

when they should be shown as:

"blockingInterstitials": {
    "bool_1": false,
    "bool_2": false
},
NghiaTranUIT commented 1 week ago

not yet, but I will include it in the next 2 release 👍

jjmean2 commented 1 week ago

Exciting news! Thanks for your concern