fix: clean metadata list before sending to backend in batch edit#32094
fix: clean metadata list before sending to backend in batch edit#32094jackjin1997 wants to merge 1 commit intolanggenius:mainfrom
Conversation
Summary of ChangesHello @jackjin1997, 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 a critical bug in the batch metadata editing feature where frontend-specific fields were inadvertently included in the data sent to the backend, leading to validation failures. By implementing a strict serialization process that filters out these extraneous fields, the PR ensures that batch metadata updates can be performed successfully, improving the reliability of data management. Additionally, unrelated changes were made to the backend to handle re-signing of file URLs within conversation fields. Highlights
🧠 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. Changelog
Activity
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 introduces backend logic to re-sign file URLs within agent thoughts and observations and fixes a frontend issue by cleaning metadata objects. However, it introduces a potential Regular Expression Denial of Service (ReDoS) vulnerability due to a greedy quantifier in the URL parsing regex. Additionally, a critical bug and areas for improvement have been identified in the new backend logic, along with opportunities to optimize the performance of the frontend data processing. The comment regarding IDOR testing is also misleading, as IDOR prevention should be handled at the authorization layer.
web/app/components/datasets/metadata/hooks/use-batch-edit-document-metadata.ts
Show resolved
Hide resolved
d01ea34 to
d428fd8
Compare
|
Cleaned up the PR by rebase/cherry-pick to remove unrelated commits and addressed the bot feedback. |
d428fd8 to
8660e66
Compare
Fixes #31964.
Addresses the issue where frontend-only fields (isUpdated, updateType, isMultipleValue) were being sent to the backend during batch metadata editing, causing validation failures.
This PR implements:
Addressing Bot Feedback: