Show a helpful error when the plan does not include snapshots - #425
Draft
anisaoshafi wants to merge 2 commits into
Draft
Show a helpful error when the plan does not include snapshots#425anisaoshafi wants to merge 2 commits into
anisaoshafi wants to merge 2 commits into
Conversation
Closes DEVX-1009 Co-Authored-By: Claude <noreply@anthropic.com>
The platform reports an unentitled plan as a 403 rather than the emulator's empty 404, so these two commands still leaked a raw status and JSON body. Co-Authored-By: Claude <noreply@anthropic.com>
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.
On a plan without snapshots, every
lstk snapshotcommand failed with a raw status code. Two different signals were leaking through:Now, for all of them:
save,load,load --dry-run,remove,list s3://…): the emulator answers with a bare404and no body when snapshots aren't licensed. All 11 client methods now recognise that and returnErrSnapshotFeatureUnavailable, rendered through one shared message.savehad no error translation at all before.list,show): the platform signals the same thing as a403, now mapped toapi.ErrCloudPodsForbiddenand rendered identically. Only403maps — a rejected token is a401and stays generic, so a re-login problem is never reported as a billing problem.": ".Scope: snapshot commands only.
lstk resetshares the state-reset request withload --merge=overwrite, so its error stays generic ("feature not available on this plan") rather than naming snapshots; giving it its own paid-plan message is a follow-up.lstk decides this from the response, not from the cached license: the license's product list is coarse and the snapshot entitlement string isn't verifiable, so checking it locally risks blocking paying customers. Trade-off —
lstk loadstill starts the emulator before failing.Verified against a real freemium account
Every command below was run against a live emulator on a freemium license, not just mocks. All seven emulator paths and both platform paths render the new message;
lstk resetcorrectly stays generic; exit code is1throughout.Raw probes confirmed the premise: all six pods routes and
state/resetreturnHTTP 404with a 0-byte body — byte-identical to a control route that doesn't exist.Testing this way is what surfaced the
403: it only reproduces against the real platform, so the original mock-only version of this PR shipped a half-fix that leftsnapshot listbroken.Automated coverage: all 11 emulator requests translate the empty
404, while a404carrying a message stays generic (keeps the check narrow);403vs401covered on the platform side; integration tests forloadandsave, both verified to fail before the fix.Review: advisable — new user-facing wording, and the emulator half keys on the shape of a response rather than an explicit signal. A server-side
402/403with a reason would remove that inference entirely and is worth a follow-up onlocalstack-pro.Closes DEVX-1009
Co-Authored-By: Claude noreply@anthropic.com
🤖 Generated with Claude Code