fix: set privacy return real error#2861
Open
PA733 wants to merge 2 commits into
Open
Conversation
Contributor
|
All contributors have signed the CLA. ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves the admin “Set Privacy” flow by returning richer backend error context (reason/stage/status/detail), surfacing that context in the frontend, and adding a dedicated success i18n key.
Changes:
- Add a
PrivacySetResultstructure and “Detailed” privacy-setting methods to propagate failure reasons/stages across services/handlers. - Update the admin account privacy endpoint to return structured error details/metadata on failure.
- Enhance the admin UI to format/privacy failure messages using API error metadata; add new i18n success string.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/views/admin/AccountsView.vue | Formats privacy set success/failure UX; pulls structured API error metadata into UI messaging. |
| frontend/src/utils/apiError.ts | Allows extracting metadata from response.data.metadata in addition to top-level err.metadata. |
| frontend/src/i18n/locales/en.ts | Adds privacySetSuccess string for improved success messaging. |
| frontend/src/i18n/locales/zh.ts | Adds privacySetSuccess string for improved success messaging. |
| backend/internal/service/openai_privacy_service.go | Introduces PrivacySetResult and detailed OpenAI privacy setting results (reason/stage/detail). |
| backend/internal/service/antigravity_privacy_service.go | Introduces detailed Antigravity privacy setting results (reason/stage/detail). |
| backend/internal/service/admin_service.go | Adds ForceOpenAIPrivacyDetailed / ForceAntigravityPrivacyDetailed to the admin service interface and implementation. |
| backend/internal/handler/admin/admin_service_stub_test.go | Updates admin service test stub to satisfy the expanded interface. |
| backend/internal/handler/admin/account_handler.go | Returns ErrorWithDetails for privacy failures, including structured metadata for the frontend. |
Comments suppressed due to low confidence (1)
backend/internal/service/antigravity_privacy_service.go:1
- The docstring states that an empty string indicates 'cannot execute'. After introducing the detailed result, ensure this comment stays accurate for all precheck conditions (notably missing
projectID, which should align with the 'cannot execute' semantics). If you keep any precheck returning a non-empty failure mode, update this comment accordingly.
package service
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
设置隐私时,后端会返回错误详情,前端会显示真正的设置结果(而不是原先始终的“操作成功”)
