Repository navigation
fix: restore admin add-tag button for users without tags - #1045
Merged
Merged
Conversation
Contributor
Reviewer's GuideRestores the admin add-tag flow by distinguishing the backend’s known missing-tag response from genuine GetBadge failures, while preserving retry behavior for actual errors and adding regression coverage for visitor/admin empty states and delete/re-create workflows. Sequence diagram for profile badge empty-state handlingsequenceDiagram
participant Visitor
participant Admin
participant Profile
participant Backend
Visitor->>Profile: InitializeProfileBadge()
Profile->>Backend: GetBadge(UserID)
Backend-->>Profile: missing-tag response
Profile-->>Visitor: Hide error and add-tag controls
Admin->>Profile: InitializeProfileBadge()
Profile->>Backend: GetBadge(UserID)
Backend-->>Profile: missing-tag response
Profile-->>Admin: Show 添加标签 button
Admin->>Profile: CreateBadge()
Profile->>Backend: CreateBadge(UserID)
Backend-->>Profile: badge data
Profile-->>Admin: Display badge
Profile->>Backend: GetBadge(UserID)
Backend-->>Profile: request failure
Profile-->>Admin: Show retry button
Admin->>Profile: Retry
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying xmoj-script-dev-channel with
|
| Latest commit: |
b4ef6b3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://281bbfd0.xmoj-script-dev-channel.pages.dev |
| Branch Preview URL: | https://codex-fix-profile-missing-ta.xmoj-script-dev-channel.pages.dev |
Contributor
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.
Re-trigger cubic
sourcery-ai
Bot
dismissed
their stale review
October 5, 2026 12:04
Sourcery withdrew this approval because the latest commits introduced blocking findings.
This was referenced Oct 6, 2026
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.
Profiles for users without tags currently show “标签暂不可用” and a retry button, leaving admins unable to add a tag. Treat the backend’s missing-tag response as an empty state, restoring the “添加标签” button for admins and hiding the error for other visitors. Account settings hides tag editing when no tag exists, preventing invalid EditBadge requests.
Both pages share detection of the missing-tag phrase, tolerating changes to the surrounding message. Actual load failures retain their error and retry behavior.
Regression coverage includes missing tags on both pages, admin creation and deletion, retry recovery, message variants, and preserving account submission.
Validation: all 99 tests pass with
npm test; JavaScript syntax andgit diff --checkpass.Summary by Sourcery
Restore correct empty-state handling for users without tags across profile and account pages.
Bug Fixes:
Enhancements:
Tests:
Chores: