Skip to content
Merged
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
13 changes: 9 additions & 4 deletions apps/desktop/src-tauri/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ impl AuthStore {
last_checked: chrono::Utc::now().timestamp() as i32,
manual: auth.plan.as_ref().is_some_and(|p| p.manual),
});
auth.organizations = api::fetch_organizations(app)
.await
.map_err(|e| e.to_string())?;
auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
match api::fetch_organizations(app).await {
Ok(orgs) => {
auth.organizations = orgs;
auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
}
Err(e) => {
tracing::warn!("Failed to fetch organizations: {e}");
}
Comment on lines +108 to +110
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Use structured logging instead of println!

The rest of the error-path in this function already uses println! (lines 81, 84), so this is consistent — but production Tauri apps typically route log::warn! / tracing::warn! through the platform logging backend (accessible in the DevTools console and system log), whereas println! only appears on stdout. A swallowed org-fetch error that only appears on stdout can be hard to surface in the field, especially on self-hosted deployments where the terminal is rarely visible.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/auth.rs
Line: 108-110

Comment:
**Use structured logging instead of `println!`**

The rest of the error-path in this function already uses `println!` (lines 81, 84), so this is consistent — but production Tauri apps typically route `log::warn!` / `tracing::warn!` through the platform logging backend (accessible in the DevTools console and system log), whereas `println!` only appears on stdout. A swallowed org-fetch error that only appears on stdout can be hard to surface in the field, especially on self-hosted deployments where the terminal is rarely visible.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

}

Self::set(app, Some(auth))?;

Expand Down
Loading