feat: asobi retention, set how long an environment keeps unclaimed guests - #51
Merged
Merged
Conversation
…ests Unclaimed guests are accounts nobody ever signed in to claim, and nothing removes them unless the environment says how long to keep them, so a game minting a guest per device accumulates them for ever. That was settable only from the dashboard, while `asobi resize` has always written the neighbouring per-environment value from here. --after is required and has no default. Retention deletes player accounts permanently and the server's sweep writes no audit row, so the period is spelled out on every invocation rather than inherited from somewhere. Validated locally against the same list the control plane accepts, which saves a round trip on a typo; the server still checks, so this is a convenience and not the guard. `1` is not on the list - a one-day retention would erase a working game's whole guest population overnight. A 403 is reported as the role refusal it is rather than as a failed call, because the generic message sends somebody off to re-run `asobi login` to fix a permission they do not have.
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.
Pairs with widgrensit/asobi_saas#286, which adds the route.
Why
Unclaimed guests are accounts nobody ever signed in to claim. Nothing removes them unless the environment says how long to keep them, so a game minting a guest per device accumulates them for ever - one live environment reached 254.
That became settable in the dashboard last week, but not here, while
asobi resizehas always written the neighbouring per-environment value from the CLI. There was no principle behind the split, just where the previous change stopped. The people most likely to want this are the ones already in a terminal cleaning up test debris.Decisions worth reviewing
--afteris required and has no default. Retention deletes player accounts permanently and the server's sweep writes no audit row, so the period is spelled out on every invocation rather than inherited from a config file or a previous value.neveris sent as a value, not an omitted field. Turning retention back off has to reach the server as a decision.TestSetRetentionSendsNeverExplicitlypins that - omitting it would read server-side as a request naming no period, and be refused.The local list is a convenience, not the guard.
RetentionPeriodssaves a round trip on a typo; the control plane validates against its own list regardless.1is absent from both - a one-day retention would erase a working game's whole guest population overnight, and it is refused for not being offered rather than by a bound somebody can talk themselves into moving.A 403 is reported as a role refusal. Guest retention is owner/admin only. The generic
retention failed (403)sends somebody off to re-runasobi loginto fix a permission they do not have, so that status gets its own message.Checks
gofmt -lclean,go vetclean,go build ./...,go test ./...all pass (5 new tests).asobi helpoutput checked.