Skip to content

SCAL-314423 GA lb feature flags#539

Open
fathima-nooha wants to merge 2 commits into
mainfrom
SCAL-314423
Open

SCAL-314423 GA lb feature flags#539
fathima-nooha wants to merge 2 commits into
mainfrom
SCAL-314423

Conversation

@fathima-nooha
Copy link
Copy Markdown
Collaborator

@fathima-nooha fathima-nooha requested a review from a team as a code owner May 25, 2026 10:27
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the AppEmbed and LiveboardEmbed classes to optimize URL parameter handling for boolean flags. By removing default false values and implementing isUndefined checks, the SDK now avoids sending unnecessary parameters to ThoughtSpot, adhering to the repository's style guide. The review feedback correctly identifies a redundant double-negation (!!) in app.ts that should be removed for better consistency and clarity.

Comment thread src/embed/app.ts
}
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
if (!isUndefined(coverAndFilterOptionInPDF)) {
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The !! coercion is redundant here because the block is already guarded by an isUndefined check, and coverAndFilterOptionInPDF is typed as a boolean. Removing it would also improve consistency with the implementation in src/embed/liveboard.ts.

Suggested change
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
References
  1. Boolean parameters for ThoughtSpot should prefer undefined over false. Omit the parameter entirely when the value is not explicitly provided, and only add it when the caller explicitly provides a value. (link)

@goutham-sidhardha
Copy link
Copy Markdown
Contributor

Summary

Promotes five Liveboard feature flags out of "opt-in" state by removing their hardcoded false defaults in AppEmbed and LiveboardEmbed. The SDK now only appends each flag to the iframe URL when the host app explicitly sets it, letting the backend's GA defaults take over otherwise.

Flags affected:

  • isLiveboardMasterpiecesEnabled
  • isLiveboardCompactHeaderEnabled
  • isEnhancedFilterInteractivityEnabled
  • hideIrrelevantChipsInLiveboardTabs
  • coverAndFilterOptionInPDF

Reasoning

  • These flags were previously gated by the SDK at false, which meant every embed silently overrode the server's setting — even after the server-side feature was rolled out generally.
  • The fix in both src/embed/app.ts and src/embed/liveboard.ts is the same shape — drop the = false destructuring default and wrap the params[...] = ... assignment in if (!isUndefined(flag)). This makes the SDK's behavior "pass through what the caller said; otherwise stay silent," which is the correct contract for a GA'd flag.
  • Existing callers that explicitly passed true or false are unaffected — the param is still forwarded with their value. Only the implicit-false callers (i.e. anyone who never set the flag) see a behavior change, and that change is the whole point: they now get the GA default from the server.

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.

2 participants