Skip to content

Commit 7ac04d0

Browse files
committed
fix: remove display name from get_info()
Display name is rarely needed for debugging, so there is no need to include it in the logs. Display name is even already listed in `skip_from_get_info`, but the test only allowed the values to be skipped without checking that they are always skipped.
1 parent a40337f commit 7ac04d0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/context.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,13 +774,11 @@ impl Context {
774774

775775
/// Returns information about the context as key-value pairs.
776776
pub async fn get_info(&self) -> Result<BTreeMap<&'static str, String>> {
777-
let unset = "0";
778777
let l = EnteredLoginParam::load(self).await?;
779778
let l2 = ConfiguredLoginParam::load(self)
780779
.await?
781780
.map_or_else(|| "Not configured".to_string(), |param| param.to_string());
782781
let secondary_addrs = self.get_secondary_self_addrs().await?.join(", ");
783-
let displayname = self.get_config(Config::Displayname).await?;
784782
let chats = get_chat_cnt(self).await?;
785783
let unblocked_msgs = message::get_unblocked_msg_cnt(self).await;
786784
let request_msgs = message::get_request_msg_cnt(self).await;
@@ -859,7 +857,6 @@ impl Context {
859857
);
860858
res.insert("journal_mode", journal_mode);
861859
res.insert("blobdir", self.get_blobdir().display().to_string());
862-
res.insert("displayname", displayname.unwrap_or_else(|| unset.into()));
863860
res.insert(
864861
"selfavatar",
865862
self.get_config(Config::Selfavatar)

src/context/context_tests.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ async fn test_get_info_completeness() {
310310
"'{key}' missing in get_info() output"
311311
);
312312
}
313+
314+
if skip_from_get_info.contains(&&*key) {
315+
assert!(
316+
!info.contains_key(&*key),
317+
"'{key}' should not be in get_info() output"
318+
);
319+
}
313320
}
314321
}
315322

0 commit comments

Comments
 (0)