Repository navigation
fix(bookmarks): publish an initial state and decode host intents so the OOP panel can render (#7) - #24
Open
abhinavtbuilds wants to merge 1 commit into
Conversation
…he OOP panel can render (risa-labs-inc#7)
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.
What this fixes
Fixes #7, taking the issue's second option. The first, a
BookmarkDataProviderIPC proxy plus abookmark.protocontract, needs new BossConsole wire surface and a host service. This makes the out-of-process bookmarks holder render and be host-drivable using only what the runtime already has.Two things kept the panel empty forever:
BookmarksStateHoldernever published. Neither constructor calledupdateState, so the holder stayed at version 0 and the host's strictly-newerapplyStateguard dropped every envelope.AGENTS.mdand five other holders' comments call this "the bookmarks failure mode"; every other holder was fixed except this one.resolveIntentDeserializer, so every intent the host sent was dropped, including theCollectionsUpdated/FavoritesUpdateddata updates that are the only way to populate it without a provider.What I changed
Initial publish. The
(scope)constructor publishesupdateState { copy(ready = true) }, and the(scope, context)constructor delegates to it, the same shape asFlowStateHolder.Honest capability flags.
BookmarksStategainsready(distinguishes "initialised, nothing synced yet" from "no state ever arrived") andpersistenceAvailable = false(create, rename and delete change only this child's copy). Both are on the wire viaStateWireJson, so a renderer can tell "unavailable" from "not sent", as with Flow's flags.decodeBookmarksIntentnext to the intent type, plus its arm inresolveIntentDeserializer. Payloads follow the other decoders:ToggleCollectionExpanded,DeleteCollection,CreateCollection,RemoveFavoriteWorkspace;OpenBookmark/RemoveBookmark(collectionId,bookmarkId),RenameCollection(collectionId,newName),AddFavoriteWorkspace(id,name);CollectionsUpdated/FavoritesUpdatedas a JSON array in the same shape asstate.collections/state.favoriteWorkspaceson the wire, so a host can send back exactly what it reads.Malformed, blank or incomplete payloads are dropped, and a JSON object is never read as a bare id (
{}does not become a collection named{}). A data update that fails to decode is dropped whole rather than applied in part.The constructor warning now says what a host has to do (push
CollectionsUpdated/FavoritesUpdated) instead of only that sync is off.Tests
BookmarksStateHolderTest(new, 8): publishes a versioned empty state on construction;persistenceAvailable=falseandready=truesurvive the wire encoder; a host populates collections and favorites through the decoder; the data-update payload round-trips from the state's own wire shape; malformed updates are dropped; every intent's payload shape; blank or missing fields,{}as an id, and unknown intents are dropped.IntentDeserializerArmsTest(+1): routes bookmarks intents, so deleting the arm fails a test, as that file intends.updateStatefails two tests, and removing the arm fails the arms test../gradlew buildpasses locally (265 tests; 256 before).Two notes
downloadDepspulls from BossConsole-Releaseslatest, which is now v9.5.21 and shipsboss-ipc-1.2.0.jar, whileipc.versionhere is still1.0.0, so the download 404s. I verified with-Pupstream.source=https://github.com/risa-labs-inc/BossConsole-Releases/releases/download/v9.5.19, the last release with the 1.0.0 jars. fix(runtime): keep state versions consistent and emit versioned state deltas #23 editsgradle.propertiesand the build workflow and may already address this.real_bookmarks_plugin_runs_but_its_state_stays_empty_upstream_gap, which asserts the child publishes no versioned state; after this it publishes one. That is the signal the issue describes for enabling the panel host-side.Applies cleanly on top of the open #22 and #23.