Skip to content

Commit

Permalink
Fix empty object in profile not exported
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbai committed May 4, 2024
1 parent 935688e commit b3f7777
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion ytflow-app-util/src/profile/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn encode_cbor_buf(buf: &[u8]) -> TomlValue {
CborValue::Text(s) => s == "__byte_repr" || s == "__toml_repr",
_ => false,
});
table.set_dotted(!(is_repr || indent > 2));
table.set_dotted(!(is_repr || indent > 2 || table.is_empty()));
TomlValue::InlineTable(table)
}
_ => return None,
Expand Down Expand Up @@ -255,6 +255,20 @@ mod tests {
&db,
)
.unwrap();
Plugin::create(
profile_id,
"ws-client".into(),
"WebSocket client.".into(),
"ws-client".into(),
0,
to_cbor(cbor!({
"headers" => {},
"next" => "client-tls.tcp"
}))
.to_vec(),
&db,
)
.unwrap();
Plugin::create(
profile_id,
"null".into(),
Expand Down Expand Up @@ -336,6 +350,14 @@ param.fallback.udp = "proxy-forward.udp"
param.fallback.resolver = "fake-ip.resolver"
updated_at = 2024-04-27T09:43:17.191
# WebSocket client.
[plugins.ws-client]
plugin = "ws-client"
plugin_version = 0
param.headers = {}
param.next = "client-tls.tcp"
updated_at = 2024-04-27T09:43:17.191
# null
[plugins.null]
plugin = "null"
Expand Down

0 comments on commit b3f7777

Please sign in to comment.