Repository navigation
SCAL-335453 Send Spotter embedParams at the top level on pre-render show - #774
Open
PunitBadjate wants to merge 1 commit into
Open
PunitBadjate wants to merge 1 commit into
PunitBadjate wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates TsEmbed to destructure and spread embedParams at the top level of the returned object in getAppInitData, ensuring that the application can read these parameters directly. Additionally, a new unit test has been added to app.spec.ts to verify that getUpdateEmbedParamsObject correctly handles and flattens the Spotter-related embed parameters. There are no review comments, and the changes look correct and well-tested, so I have no feedback to provide.
commit: |
This branch has not been deployed
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
When a pre-rendered embed is shown, the SDK sends its config in
HostEvent.UpdateEmbedParams. That payload spread the whole app-init data,so the values built by
spotter-utils.tsandspotter-viz-utils.tsarrivednested under an
embedParamskey. The app uses theUpdateEmbedParamspayload as its embed params as-is, and reads these values at the top level,
so in pre-render they were ignored:
spotterVizConfig(SpotterViz branding, prompts, loader text, file upload)starterPromptsvisualOverridesParamsenableSpotterInstructionAndMoreSettingsspotterSidebarConfig(the rawviewConfigcopy was usedinstead, without the standalone
enablePastConversationsSidebarmerge orthe documentation URL validation)
Configs whose
viewConfigname matches the app's(
spotterShareConversationConfig,spotterAnalystConfig,spotterUsageLimitConfig) only worked by chance, skipping the builders'checks. The APP_INIT path was unaffected: the app flattens
embedParamsthere.
Changes
ts-embed.tsgetUpdateEmbedParamsObject(): takeembedParamsout of theapp-init data and spread its contents at the top level of the payload,
after
viewConfig, so the built values win over the raw ones. This matcheswhat the app does with APP_INIT data. It applies to every embed that adds
embedParamsingetAppInitData()(AppEmbed, ConversationEmbed,LiveboardEmbed); embeds without it are unchanged.
spotter-utils.ts/spotter-viz-utils.ts: the APP_INIT pathstill needs their nested
embedParams.