A local-first private AI assistant for everyday use. Runs on-device models with encrypted P2P sync, and supports sharing chats publicly on ATProto.
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor

madclaws 690b2dd8 e0d80f03

+17 -8
-4
Cargo.toml
··· 4 4 "tilekit", 5 5 "tiles", 6 6 ] 7 - 8 - 9 - [workspace.lints.clippy] 10 - pedantic = "warn"
+1 -1
tiles/src/core/accounts.rs
··· 353 353 updated_at: updated_at as u64, 354 354 }) 355 355 } 356 - /// Gets a peer by its DID 356 + /// Gets a user account by its DID 357 357 pub fn get_user_info(conn: &Connection, did: &str) -> Result<User> { 358 358 let mut fetch_user = conn.prepare("select id, user_id, username, account_type, active_profile, root, created_at, updated_at from users where user_id = ?1")?; 359 359
+3 -2
tiles/src/core/chats.rs
··· 199 199 Err(rusqlite::Error::SqliteFailure(_, Some(reason))) 200 200 if reason == "UNIQUE constraint failed: chats.id" => 201 201 { 202 - log::warn!( 202 + log::error!( 203 203 "err in writing row {:?}, already exists, skipping", 204 204 &chat.id 205 205 ); 206 206 } 207 - _ => (), 207 + Err(err) => log::error!("err in writing row due to {:?}", err), 208 + Ok(_) => (), 208 209 } 209 210 } 210 211 }
+13 -1
tiles/src/core/network/mod.rs
··· 47 47 use owo_colors::OwoColorize; 48 48 use sha2::{Digest, Sha256}; 49 49 50 + // 50 mb 51 + const MAX_DOWNLOADED_BYTES: usize = 50 * 1024 * 1024; 52 + 50 53 const DEVICE_LINK_LOCAL_TOPIC: &str = "com.tilesprivacy.tiles.link"; 51 54 #[derive(serde::Serialize, serde::Deserialize)] 52 55 struct NetworkMessage { ··· 424 427 let mdns = address_lookup::mdns::MdnsAddressLookup::builder().build(endpoint.id())?; 425 428 endpoint.address_lookup()?.add(mdns.clone()); 426 429 } 430 + 427 431 let tx = create_sync_channel(); 428 432 if let Some(receiver_did) = did { 429 433 // INITIATOR BLOCK ··· 735 739 .await?; 736 740 737 741 let data = store.blobs().get_bytes(ticket.hash()).await?; 742 + info!("Downloaded data diff"); 738 743 739 - info!("Downloaded data diff"); 744 + if data.len() > MAX_DOWNLOADED_BYTES { 745 + log::error!( 746 + "Downloaded delta is greater than {}, skipping the sync", 747 + MAX_DOWNLOADED_BYTES 748 + ); 749 + return Ok(()); 750 + } 751 + 740 752 let (sendx, recvx) = oneshot::channel(); 741 753 let sync_op_msg = SyncOp::ApplyDelta { 742 754 delta: data.to_vec(),