Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtensionStateContext does not correctly merge state #1322

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

cte
Copy link
Collaborator

@cte cte commented Mar 2, 2025

Context

We weren't correctly merging the extension state when receiving "state" updates in the webview from the extension. This was a pretty subtle bug, but the blank initial model id in the WelcomeView exposed it nicely.

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Fixes state merging in ExtensionStateContext by introducing mergeExtensionState and updates tests accordingly.

  • Behavior:
    • Introduces mergeExtensionState in ExtensionStateContext.tsx to correctly merge ExtensionState objects.
    • Updates ExtensionStateContextProvider to use mergeExtensionState for handling "state" messages.
  • Tests:
    • Adds test for mergeExtensionState in ExtensionStateContext.test.tsx to verify correct merging of apiConfiguration properties.
    • Updates existing tests to ensure compatibility with new merging logic.

This description was created by Ellipsis for e201ee8. It will automatically update as commits are pushed.

@cte cte requested a review from mrubens as a code owner March 2, 2025 23:03
Copy link

changeset-bot bot commented Mar 2, 2025

🦋 Changeset detected

Latest commit: e201ee8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Mar 2, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 2, 2025
@cte cte force-pushed the cte/fix-extension-state branch from 7673f21 to b0f1eb6 Compare March 2, 2025 23:17
cte and others added 2 commits March 2, 2025 15:20
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@cte cte merged commit 8e8079d into main Mar 3, 2025
9 checks passed
@cte cte deleted the cte/fix-extension-state branch March 3, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants