Skip to content

Handle Bluesky profile updates gracefully#176

Open
disnet wants to merge 1 commit intomainfrom
card/3mhjhucuzkk2v
Open

Handle Bluesky profile updates gracefully#176
disnet wants to merge 1 commit intomainfrom
card/3mhjhucuzkk2v

Conversation

@disnet
Copy link
Owner

@disnet disnet commented Mar 21, 2026

Summary

  • Frontend profile refresh: On app init and tab visibility change, fetch fresh profile data from Bluesky public API (non-blocking, uses existing ProfileService with 5-min TTL cache). Updates avatar, handle, and display name if changed.
  • Avatar error fallback: Broken avatar URLs now show a placeholder circle instead of a broken image icon, in both the sidebar and settings page.
  • Backend stale profile refresh: handleAuthMe checks profile_updated_at and re-fetches from Bluesky if >24h stale, updating both the session and users table.
  • Migration: Adds profile_updated_at column to users table.

Test plan

  • Change Bluesky profile picture, reload Skyreader — avatar updates within seconds
  • Return to Skyreader tab after changing profile — avatar updates on focus
  • Simulate broken avatar URL — placeholder shown instead of broken image
  • Handle/display name changes also picked up
  • Backend tests pass (88/88)
  • No excessive API calls (ProfileService TTL prevents spam)

🤖 Generated with Claude Code

Profile data was only fetched at OAuth login time and cached forever.
When users changed their Bluesky profile picture, the old CDN URL
would break, showing a broken image in the sidebar.

Frontend:
- Refresh profile from Bluesky public API on app init and tab focus
  (non-blocking, uses ProfileService's 5-min TTL cache)
- Add onerror fallback on avatar images to show placeholder on broken URLs

Backend:
- Refresh stale profile data (>24h) in handleAuthMe endpoint
- Add profile_updated_at column to users table
- Update session and user records when profile changes detected

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant