Skip to content

Commit f18b0d3

Browse files
test(db): seed canonical large roster fixture
Signed-off-by: tornquist <[email protected]>
1 parent 19f2b86 commit f18b0d3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎crates/buzz-db/src/feed.rs‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,19 @@ mod tests {
904904

905905
// 11,000 rows x 6 binds = 66,000 > 65,535: overflows a single statement.
906906
let mention_count = 11_000usize;
907+
sqlx::query(
908+
"INSERT INTO channel_members (community_id, channel_id, pubkey, role) \
909+
SELECT $1, $2, decode(lpad(to_hex(n), 64, '0'), 'hex'), 'member' \
910+
FROM generate_series(1, $3) n",
911+
)
912+
.bind(community.as_uuid())
913+
.bind(channel)
914+
.bind(mention_count as i64)
915+
.execute(&pool)
916+
.await
917+
.expect("insert canonical roster members");
907918
let tags: Vec<Tag> = (1..=mention_count)
908-
.map(|n| Tag::parse(["p", &format!("{n:064x}")]).expect("p tag"))
919+
.map(|n| Tag::parse(["p", &format!("{n:064x}"), "", "member"]).expect("p tag"))
909920
.collect();
910921
let event = store_feed_event(&pool, community, 39002, "", Some(channel), tags).await;
911922

0 commit comments

Comments
 (0)