Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions crates/collab/src/db/queries/shared_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ impl Database {
return Ok(None);
};

let user = user::Entity::find_by_id(thread.user_id).one(&*tx).await?;

let username = user
.map(|u| u.github_login)
.unwrap_or_else(|| "Unknown".to_string());
// We can no longer read the `github_login` from Collab.
//
// Opting to just use "Unknown" here, as the feature is staff-only and infrequently used.
let username = "Unknown".to_string();

Ok(Some((thread, username)))
})
Expand Down
2 changes: 2 additions & 0 deletions crates/collab/src/db/tables/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use serde::Serialize;
pub struct Model {
#[sea_orm(primary_key)]
pub id: UserId,
#[cfg(feature = "test-support")]
pub github_login: String,
#[cfg(feature = "test-support")]
pub github_user_id: i32,
pub admin: bool,
pub connected_once: bool,
Expand Down
2 changes: 1 addition & 1 deletion crates/collab/tests/integration/db_tests/db_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async fn test_upsert_shared_thread(db: &Arc<Database>) {
assert_eq!(thread.title, title);
assert_eq!(thread.data, data);
assert_eq!(thread.user_id, user_id);
assert_eq!(username, "user1");
assert_eq!(username, "Unknown");
}

test_both_dbs!(
Expand Down
Loading