BlueSky & more on desktop lazurite.stormlightlabs.org/
tauri rust typescript bluesky appview atproto solid
2
fork

Configure Feed

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

feat: add logs around notifications request

+37 -10
+5
docs/todo.md
··· 39 39 - [ ] Network relationship diff over time (requires historical snapshots) 40 40 - [ ] Profile/identity history timeline (handle/DID/PDS changes) 41 41 - [ ] Starter Pack search? 42 + 43 + ## Release Readiness 44 + 45 + - [ ] Composer UI should be vertically centered (in the full window) with a more padding 46 + in the input area. The backdrop needs a lower opacity as well.
+22
src-tauri/src/error.rs
··· 2 2 3 3 pub type Result<T> = std::result::Result<T, AppError>; 4 4 5 + fn log_chain_with_level(level: log::Level, context: &str, error: &impl std::error::Error) { 6 + log::log!(level, "{context}: {error}"); 7 + log::log!(level, "{context} debug: {error:?}"); 8 + 9 + let mut source = error.source(); 10 + let mut depth = 0; 11 + 12 + while let Some(cause) = source { 13 + depth += 1; 14 + log::log!(level, "{context} cause[{depth}]: {cause}"); 15 + source = cause.source(); 16 + } 17 + } 18 + 19 + pub fn log_error_chain(context: &str, error: &impl std::error::Error) { 20 + log_chain_with_level(log::Level::Error, context, error); 21 + } 22 + 23 + pub fn log_warn_chain(context: &str, error: &impl std::error::Error) { 24 + log_chain_with_level(log::Level::Warn, context, error); 25 + } 26 + 5 27 #[derive(Debug, Clone, Copy, PartialEq, Eq)] 6 28 pub enum TypeaheadFetchErrorKind { 7 29 Decode,
+9 -9
src-tauri/src/notifications.rs
··· 1 1 use super::auth::LazuriteOAuthSession; 2 - use super::error::{AppError, Result}; 2 + use super::error::{log_error_chain, log_warn_chain, AppError, Result}; 3 3 use super::settings::{self, AppSettings}; 4 4 use super::state::AppState; 5 5 use jacquard::api::app_bsky::notification::get_unread_count::GetUnreadCount; ··· 76 76 .send(req.build()) 77 77 .await 78 78 .map_err(|error| { 79 - log::error!("listNotifications error: {error}"); 79 + log_error_chain("listNotifications error", &error); 80 80 AppError::validation("listNotifications error") 81 81 })? 82 82 .into_output() 83 83 .map_err(|error| { 84 - log::error!("listNotifications output error: {error}"); 84 + log_error_chain("listNotifications output error", &error); 85 85 AppError::validation("listNotifications output error") 86 86 })?; 87 87 ··· 95 95 .send(UpdateSeen::new().seen_at(Datetime::now()).build()) 96 96 .await 97 97 .map_err(|error| { 98 - log::error!("updateSeen error: {error}"); 98 + log_error_chain("updateSeen error", &error); 99 99 AppError::validation("updateSeen error") 100 100 })?; 101 101 ··· 104 104 } 105 105 106 106 response.into_output().map_err(|error| { 107 - log::error!("updateSeen output error: {error}"); 107 + log_error_chain("updateSeen output error", &error); 108 108 AppError::validation("updateSeen output error") 109 109 })?; 110 110 ··· 118 118 .send(GetUnreadCount::new().build()) 119 119 .await 120 120 .map_err(|error| { 121 - log::error!("getUnreadCount error: {error}"); 122 - AppError::validation("getUnreadCount error") 121 + log_warn_chain("getUnreadCount error", &error); 122 + AppError::Validation("getUnreadCount error".into()) 123 123 })? 124 124 .into_output() 125 125 .map_err(|error| { 126 - log::error!("getUnreadCount output error: {error}"); 127 - AppError::validation("getUnreadCount output error") 126 + log_warn_chain("getUnreadCount output error", &error); 127 + AppError::Validation("getUnreadCount output error".into()) 128 128 })?; 129 129 130 130 Ok(output.count)
+1 -1
src/components/search/HashtagPanel.tsx
··· 189 189 <div class="grid gap-1"> 190 190 <h1 class="m-0 text-3xl font-semibold tracking-[-0.03em] text-on-surface">{props.hashtagLabel}</h1> 191 191 <p class="m-0 text-sm text-on-surface-variant"> 192 - Search public Bluesky posts for this hashtag with URL-synced network filters. 192 + Search Bluesky for this hashtag. 193 193 </p> 194 194 </div> 195 195 </div>