-
Notifications
You must be signed in to change notification settings - Fork 8
SCAL-287989 hidePrerender fix #389
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @yinstardev, 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 fix for the Highlights
Using Gemini Code AssistThe 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
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 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
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this 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 introduces an override for the hidePreRender method in the AppEmbed class. The new method correctly calls unregisterLazyLoadEvents to clean up event listeners specific to AppEmbed before calling the parent's hidePreRender method. My review includes one high-severity finding related to a potential memory leak in the unregisterLazyLoadEvents method, which is now being called by the newly added code. Additionally, no new tests have been added to verify the behavior of the new hidePreRender method. It would be beneficial to add a unit test to src/embed/app.spec.ts to ensure unregisterLazyLoadEvents is called and that the event listeners are correctly removed. This could also help confirm the fix for the memory leak.
| * Hides the PreRender component and cleans up event listeners. | ||
| */ | ||
| public hidePreRender(): void { | ||
| this.unregisterLazyLoadEvents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unregisterLazyLoadEvents method has a bug that will cause a memory leak. The scroll event listener is registered with useCapture: true in registerLazyLoadEvents (line 1056), but unregisterLazyLoadEvents attempts to remove it without specifying useCapture: true (line 1063). For removeEventListener to work correctly, it must be called with the same arguments as addEventListener. Please update unregisterLazyLoadEvents to correctly remove the listener.
commit: |
|
SonarQube Quality Gate
|








No description provided.