fix: convert session_present flag to boolean to follow the declared type#242
fix: convert session_present flag to boolean to follow the declared type#242SergeTupchiy wants to merge 1 commit into
session_present flag to boolean to follow the declared type#242Conversation
|
NOTE: it will break a few tests in emqx. |
| redact_packet(Packet) -> | ||
| Packet. | ||
|
|
||
| flag_to_bool(0) -> false; |
There was a problem hiding this comment.
Alternatively, can be fixed in https://github.com/emqx/emqtt/blob/fix-session_present-type/src/emqtt_frame.erl#L218
similarly to how CONNECT packet flags are parsed to bools: https://github.com/emqx/emqtt/blob/fix-session_present-type/src/emqtt_frame.erl#L202
But it would require changing the record field, e.g:
#mqtt_packet_connack{session_present = SessionPresent,
Instead of:
#mqtt_packet_connack{ack_flags = AckFlags,
|
I think it is a good change but may break many places, worth it? |
No reason, besides improving consistency (other flags are converted and stored as boolean). Instead of this fix, we may change type of |
IMO, using a boolean is more semantic for this case. Maybe we could indicate this is a breaking change with a major version bump? |
No description provided.