Parakeet is a Rust-based Bluesky AppServer aiming to implement most of the functionality required to support the Bluesky client
appview atproto bluesky rust appserver

fix!: really really stupid threadgate mistake

this will likely require a full reindex to fix.

mia.omg.lol 8722e61a 1e536016

verified
+20 -19
+15 -13
consumer/src/db/record.rs
··· 708 708 ) -> PgExecResult { 709 709 let record = serde_json::to_value(&rec).unwrap(); 710 710 711 - let allowed_lists = rec 712 - .allow 713 - .iter() 714 - .filter_map(|rule| match rule { 715 - ThreadgateRule::List { list } => Some(list.clone()), 716 - _ => None, 717 - }) 718 - .collect::<Vec<_>>(); 711 + let allowed_lists = rec.allow.as_ref().map(|allow| { 712 + allow 713 + .iter() 714 + .filter_map(|rule| match rule { 715 + ThreadgateRule::List { list } => Some(list.clone()), 716 + _ => None, 717 + }) 718 + .collect::<Vec<_>>() 719 + }); 719 720 720 - let allow = rec 721 - .allow 722 - .into_iter() 723 - .map(|v| v.as_str().to_string()) 724 - .collect::<Vec<_>>(); 721 + let allow = rec.allow.map(|allow| { 722 + allow 723 + .into_iter() 724 + .map(|v| v.as_str().to_string()) 725 + .collect::<Vec<_>>() 726 + }); 725 727 726 728 conn.execute( 727 729 include_str!("sql/threadgate_upsert.sql"),
+1 -2
consumer/src/indexer/records.rs
··· 267 267 pub struct AppBskyFeedThreadgate { 268 268 pub post: String, 269 269 pub created_at: DateTime<Utc>, 270 - #[serde(default)] 271 - pub allow: Vec<ThreadgateRule>, 270 + pub allow: Option<Vec<ThreadgateRule>>, 272 271 #[serde(default)] 273 272 pub hidden_replies: Vec<String>, 274 273 }
+2 -2
migrations/2025-02-16-142357_posts/up.sql
··· 123 123 post_uri text not null, 124 124 125 125 hidden_replies text[] not null, 126 - allow text[] not null, 127 - allowed_lists text[] not null, 126 + allow text[], 127 + allowed_lists text[], 128 128 129 129 record jsonb not null, 130 130
+2 -2
parakeet-db/src/schema.rs
··· 378 378 cid -> Text, 379 379 post_uri -> Text, 380 380 hidden_replies -> Array<Nullable<Text>>, 381 - allow -> Array<Nullable<Text>>, 382 - allowed_lists -> Array<Nullable<Text>>, 381 + allow -> Nullable<Array<Nullable<Text>>>, 382 + allowed_lists -> Nullable<Array<Nullable<Text>>>, 383 383 record -> Jsonb, 384 384 created_at -> Timestamptz, 385 385 indexed_at -> Timestamp,