Skip to content

fix: set privacy return real error#2861

Open
PA733 wants to merge 2 commits into
Wei-Shaw:mainfrom
PA733:fix/set-privacy
Open

fix: set privacy return real error#2861
PA733 wants to merge 2 commits into
Wei-Shaw:mainfrom
PA733:fix/set-privacy

Conversation

@PA733
Copy link
Copy Markdown

@PA733 PA733 commented May 28, 2026

设置隐私时,后端会返回错误详情,前端会显示真正的设置结果(而不是原先始终的“操作成功”)
image

Copilot AI review requested due to automatic review settings May 28, 2026 12:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@PA733
Copy link
Copy Markdown
Author

PA733 commented May 28, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 PrivacySetResult structure 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.

Comment thread backend/internal/service/antigravity_privacy_service.go
Comment thread backend/internal/service/openai_privacy_service.go
Comment thread backend/internal/handler/admin/account_handler.go
Comment thread backend/internal/handler/admin/account_handler.go
Comment thread backend/internal/handler/admin/account_handler.go
Comment thread frontend/src/views/admin/AccountsView.vue Outdated
Comment thread frontend/src/views/admin/AccountsView.vue Outdated
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.

2 participants