Skip to content

Conversation

@jhodapp
Copy link
Member

@jhodapp jhodapp commented Nov 14, 2025

Description

Fixes the bug where navigating between coaching sessions with different relationships (e.g. from Today's Sessions) displays the wrong coachee name in the session title while showing the correct notes.

GitHub Issue: Fixes #228

Changes

  • Updated auto-sync logic to trigger when relationship ID differs from session (not just when empty)
  • Added shouldSyncRelationship helper function for improved readability and maintainability
  • Added refresh() call after setting new relationship ID to force immediate fetch of correct relationship data
  • Added comprehensive test coverage including regression tests for Issue [Bug]: Opening the same coaching session across two tabs in the same browser fails #79

Testing Strategy

Automated:

Manual verification needed:

  1. Navigate to a session with Coachee A
  2. Click on a different session with Coachee B from Today's Sessions
  3. Verify the session title shows Coachee B's name (not Coachee A)
  4. Test new tab scenario still works (Issue [Bug]: Opening the same coaching session across two tabs in the same browser fails #79)

Concerns

None - the fix aligns with the codebase's URL-first architecture and preserves all existing functionality.

… sessions

When navigating between sessions with different relationships, the page
displayed wrong coachee names while showing correct notes. Fixed by:

- Updated auto-sync to trigger when relationship ID differs (not just when empty)
- Added shouldSyncRelationship helper for readability
- Call refresh() after setting new relationship ID to fetch correct data
- Added comprehensive test coverage for all sync scenarios

Fixes #228
@jhodapp jhodapp self-assigned this Nov 14, 2025
@jhodapp jhodapp added the bug fix Fixes a specific Issue label Nov 14, 2025
@jhodapp jhodapp added this to the 1.0.0-beta2 milestone Nov 14, 2025
@jhodapp jhodapp requested a review from calebbourg November 14, 2025 05:36
- Extract shouldSyncRelationship to separate module with unit tests
- Add explicit return type interfaces for hooks
- Create type-safe test factory for CoachingSession (removes 'as any')
- Add const assertions to test mock parameters for immutability
- Rename coaching_relationship.ts to coaching-relationship.ts for consistency
- Update all imports to use hyphenated naming convention
- Fix type signatures to allow null coaching relationship IDs
- Add 9 comprehensive unit tests for shouldSyncRelationship helper

These changes improve type safety, maintainability, and follow TypeScript best practices without changing functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixes a specific Issue

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

[Bug]: Today's Session doesn't update the current coaching relationship fully

2 participants