Fix navigation login state and improve user activity stats#506
Merged
Conversation
- Fix navigation showing "Log in/Sign up" when user is authenticated by adding session refresh to `getUserFromRequest()` and updating the cookie when refreshed - Hide "0 Messages" and "0 Active Days" stats when there's no activity - Include web chat messages in user stats alongside Slack activity by: - Adding `getUserActivityStats()` method to thread-service.ts - Adding `conversation_activity` to member context - Updating stats builder and renderer to prefer combined stats - Use `last_message_at` instead of `started_at` for active days calculation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix navigation showing "Log in/Sign up" when user is authenticated - The
getUserFromRequest()function wasn't refreshing expired WorkOS sessions, causing the nav bar to show logged-out state even when API calls correctly authenticated the user. Now properly refreshes the session and updates the cookie.Hide empty activity stats - No longer display "0 Messages" and "0 Active Days" when there's no activity - not useful UX.
Include web chat messages in user stats - Previously only counted Slack activity. Now queries the unified
addie_threadstable which includes both Slack and web chat conversations, so users who prefer web chat see their activity reflected.Test plan
🤖 Generated with Claude Code