Update AccessToken Status When Site is Deleted#2416
Open
shailie-1998 wants to merge 1 commit intoskupperproject:mainfrom
Open
Update AccessToken Status When Site is Deleted#2416shailie-1998 wants to merge 1 commit intoskupperproject:mainfrom
shailie-1998 wants to merge 1 commit intoskupperproject:mainfrom
Conversation
Collaborator
Author
|
Fixes #2408 |
fgiorgetti
reviewed
Mar 30, 2026
Comment on lines
+1189
to
+1195
| wasOperational := link.IsReady() | ||
| if link.SetOperational(operational, remoteSiteId, remoteSiteName) { | ||
| return s.updateLinkStatus(link) | ||
| err := s.updateLinkStatus(link) | ||
| // If link became non-operational, update associated access tokens | ||
| if wasOperational && !operational { | ||
| s.updateAccessTokensForLink(link) | ||
| } |
Member
There was a problem hiding this comment.
@shailie-1998 I do not think this change is needed.
The state of a Link resource which was generated from an AccessToken, should not affect the state of the AccessToken itself.
| for _, token := range tokenList.Items { | ||
| if token.IsRedeemed() { | ||
| // Mark the token as failed due to site deletion | ||
| if token.SetRedeemedWithSiteDeletion(fmt.Errorf("Site has been deleted")) { |
Member
There was a problem hiding this comment.
If a Site is deleted but then a new one is created, right after that, this message might confuse users, as it says that the site has been deleted, but there is a site on the namespace.
What if we use something more precise, like: Already redeemed for a deleted site ?
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.
Summary
This PR implements functionality to update AccessToken status when a site is deleted, covering two scenarios: local site deletion and remote site deletion.
Solution
Scenario 1: Local Site Deletion
Implementation:
Test Evidence
Scenario 2: Remote Site Deletion
Implementation:
Test Evidence