fix(video-assignment): clear pending resolves and fix bogus error log#133
fix(video-assignment): clear pending resolves and fix bogus error log#133totoathos wants to merge 3 commits intogoogleworkspace:mainfrom
Conversation
Summary of ChangesHello @totoathos, 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 addresses two key issues: reducing log noise by making an error message conditional and preventing a potential memory leak by guaranteeing cleanup of pending request resolvers. These changes improve system stability and maintainability by ensuring cleaner logs and more efficient resource management. Highlights
Changelog
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
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses two issues: a memory leak in video_assignment_channel_handler by ensuring pending request resolvers are always cleared, and a bogus error log that was being emitted unconditionally. The use of try/finally to guarantee cleanup is a solid defensive programming practice. My review includes a couple of minor suggestions to improve code style for better consistency and readability.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
What changed
Fixed an error log in video_assignment_channel_handler that was being emitted unconditionally. It now logs only when the server sends a canvas ID that the client never created (missing layout).
Prevented a memory/state leak by always clearing pendingRequestResolveMap entries when onVideoAssignmentResponse is received (using try/finally to guarantee cleanup even if the callback throws).
Why
The bogus error log polluted logs and made real issues harder to spot.
Pending request resolvers were never removed, causing unbounded growth during long sessions or retries.
Files
web/internal/channel_handlers/video_assignment_channel_handler.ts