Skip to content

Conversation

@pranjal-jately-ld
Copy link
Contributor

@pranjal-jately-ld pranjal-jately-ld commented Jan 4, 2026

Fixes issues where active context visual indicators (blue background) disappeared after editing and contexts were being duplicated on page refresh/sharing URL . Contexts are now identified by their kind+key combination using getStableContextId().

  • Remove generateContextId() and hash-based ID generation
  • Update ContextsProvider to use stable IDs for tracking active context
  • Sync context updates with LD SDK via ldClient.identify()
  • Remove deprecated areContextsEqual() in favor of stable ID comparison
  • Update all tests to reflect stable ID behavior

Description

What does this PR do?

This PR fixes context identification to use stable IDs based on kind+key instead of hash-based IDs that include all properties. This resolves critical issues where:

  1. Active context visual indicators (blue border/dot) disappeared after editing a context
  2. Context edits reverted to original values after page refresh
  3. Duplicate contexts appeared after refresh

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation (changes to documentation only)
  • 🔧 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🎨 Style (formatting, missing semicolons, etc; no production code change)
  • Performance (code change that improves performance)
  • Test (adding missing tests, refactoring tests; no production code change)
  • 🔨 Chore (updating grunt tasks, build process, etc; no production code change)

Screenshots/Videos


@pranjal-jately-ld pranjal-jately-ld marked this pull request as ready for review January 5, 2026 19:45
@pranjal-jately-ld pranjal-jately-ld requested a review from a team as a code owner January 5, 2026 19:45
Copy link
Contributor

@cspath1 cspath1 left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this! Really like this solution in general, but glad to see it's helping fix the issues mentioned.

Fixes issues where active context visual indicators (blue background)
disappeared after editing and context edits reverted on page refresh. Contexts
are now identified by their kind+key combination using getStableContextId().

- Remove generateContextId() and hash-based ID generation
- Update ContextsProvider to use stable IDs for tracking active context
- Sync context updates with LD SDK via ldClient.identify()
- Remove deprecated areContextsEqual() in favor of stable ID comparison
- Update all tests to reflect stable ID behavior
@pranjal-jately-ld pranjal-jately-ld force-pushed the pjately/fix-context-identification-with-stable-ids branch from 6425dde to 6ba9eec Compare January 6, 2026 15:13
@pranjal-jately-ld pranjal-jately-ld merged commit 1fa2e1e into main Jan 6, 2026
4 checks passed
@pranjal-jately-ld pranjal-jately-ld deleted the pjately/fix-context-identification-with-stable-ids branch January 6, 2026 15:20
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.

3 participants