Skip to content

Conversation

@shivam-kumar-ts
Copy link
Contributor

@shivam-kumar-ts shivam-kumar-ts commented Dec 24, 2025

STILL WORKING NEED MORE CHANGES IN SDK

@shivam-kumar-ts shivam-kumar-ts requested a review from a team as a code owner December 24, 2025 03:14
@mnk-blr
Copy link
Collaborator

mnk-blr commented Dec 24, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shivam-kumar-ts, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant change to the default handling of runtime filters and parameters in embedded views. Previously, these were included in the URL by default, but now the default behavior is to exclude them, promoting cleaner URLs and potentially enhancing privacy. The change is reflected in the core embedding logic, updated documentation, and adjusted test cases to ensure compatibility and correctness.

Highlights

  • Default Behavior Change: The default values for excludeRuntimeFiltersfromURL and excludeRuntimeParametersfromURL have been updated from false to true. This means that by default, runtime filters and parameters will now be excluded from the URL when embedding views.
  • Documentation Update: The JSDoc comments in src/types.ts have been updated to accurately reflect the new default value of true for these exclusion flags.
  • Test Case Adjustments: Existing test cases in src/embed/embed.spec.ts, src/embed/search.spec.ts, and src/embed/ts-embed.spec.ts have been modified to explicitly set these flags to false or undefined where necessary, ensuring tests continue to function as expected with the new default behavior.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 24, 2025

Open in StackBlitz

npm i https://pkg.pr.new/thoughtspot/visual-embed-sdk/@thoughtspot/visual-embed-sdk@397

commit: eddfff4

Copy link
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 updates the default value for excludeRuntimeFiltersfromURL and excludeRuntimeParametersfromURL to true. The changes in the type definitions and test files are consistent with this new default.

However, I found an issue in how the default values are applied in the TsEmbed constructor. If viewConfig provides undefined for these properties, it overrides the default, leading to unexpected behavior. I've suggested a fix to make the default value assignment more robust.

Additionally, one of the updated tests in ts-embed.spec.ts seems to assert the current buggy behavior. I've left a comment explaining why it should be adjusted to align with the corrected logic.

Comment on lines 197 to 201
this.viewConfig = {
excludeRuntimeFiltersfromURL: false,
excludeRuntimeParametersfromURL: false,
excludeRuntimeFiltersfromURL: true,
excludeRuntimeParametersfromURL: true,
...viewConfig,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current implementation for setting default values for excludeRuntimeFiltersfromURL and excludeRuntimeParametersfromURL has a potential issue. When viewConfig contains these properties with an undefined value, the default values (true) are overridden with undefined. This can lead to unexpected behavior, as undefined is treated as falsy, effectively behaving like false instead of the intended default of true.

To ensure that undefined values correctly fall back to the default, I suggest applying the defaults after spreading viewConfig and using the nullish coalescing operator (??). This makes the default assignment more robust.

Suggested change
this.viewConfig = {
excludeRuntimeFiltersfromURL: false,
excludeRuntimeParametersfromURL: false,
excludeRuntimeFiltersfromURL: true,
excludeRuntimeParametersfromURL: true,
...viewConfig,
};
this.viewConfig = {
...viewConfig,
excludeRuntimeFiltersfromURL: viewConfig?.excludeRuntimeFiltersfromURL ?? true,
excludeRuntimeParametersfromURL: viewConfig?.excludeRuntimeParametersfromURL ?? true,
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since default value is we have to consider as true, so undefine is also consider as true

const searchEmbed = new SearchEmbed(getRootEl(), {
...defaultViewConfig,
runtimeFilters: mockRuntimeFilters,
excludeRuntimeFiltersfromURL: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This test case seems to assert that excludeRuntimeFiltersfromURL: undefined should behave like false, meaning runtime filters are not included in the APP_INIT payload. However, undefined should ideally fall back to the default value, which is now true. With the default value of true, runtime filters should be included in the APP_INIT payload. I've suggested a fix in src/embed/ts-embed.ts to handle undefined correctly. With that fix, this test will fail. This test should be updated to reflect the expected behavior where undefined acts like the default true.

Copy link
Contributor Author

@shivam-kumar-ts shivam-kumar-ts Dec 24, 2025

Choose a reason for hiding this comment

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

DONE

@sonar-prod-ts
Copy link

sonar-prod-ts bot commented Dec 25, 2025

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@shivam-kumar-ts shivam-kumar-ts changed the title SCAL-286984 Update excludes filters defaults to true SCAL-286984 Set default values true for excludeRuntimeFiltersfromURL and excludeRuntimeParametersfromURL Dec 25, 2025
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.

4 participants