Move screen add, delete and the token check off v3 - #328
Merged
Merged
Conversation
The v3 API is being retired with the legacy app server, and these were the last three calls the CLI made to it. Adding a screen now posts to v4.1, which answers with the new id alone, so the screen is read back to keep the command's output the same. Deleting filters on the id the way the other v4 calls do. Verifying a token asked v3 for a group that does not exist and took the 404 as proof the token was good. It now reads a single screen and takes 200 as proof, which also means an invalid token is rejected rather than reported as valid.
… a redundant comment
sergey-borovkov
approved these changes
Sep 29, 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.
Why
The v3 API is being retired along with the legacy app server. Screen add,
screen delete and the token check on login were the last three places the CLI
still used it, so they stop working when it goes.
What
Adding a screen posts to v4.1 instead. That endpoint answers with the id of the
new screen and nothing else, so the screen is read back before returning, and
screen addprints what it printed before.Deleting a screen filters on the id, the same way the other v4 screen calls do.
Verifying a token used to ask v3 for a group that does not exist and treat the
404 as proof that the token was accepted. It now reads a single screen and
treats 200 as proof. That also fixes a real problem with the old approach: a
request that failed for any other reason also came back 404, so a bad token
could look valid at login and only fail later.
One of the tests for the old behaviour was passing for the same reason — its
mock asserted a different token than the test supplied, so the request never
matched and the mock server's own 404 was read as success. The mock now
asserts the token the test actually sends.