Treat all queue names as strings to avoid JSON confusion#1
Open
tbartlett0 wants to merge 2 commits intoACSC-CyberLab:masterfrom
Open
Treat all queue names as strings to avoid JSON confusion#1tbartlett0 wants to merge 2 commits intoACSC-CyberLab:masterfrom
tbartlett0 wants to merge 2 commits intoACSC-CyberLab:masterfrom
Conversation
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.
restq passes or returns queue IDs in JSON mappings (dicts) at a few points. JSON doesn't support numeric indexes in dicts, so the client has no way to know if the original queue ID was a string or an integer.
If the client calls /<realm>/status and sees a queue called str("1"), and then asks to set queue lease time for queue str("1"), but the server actually has a queue called int(1), then the server will create a NEW queue called str("1") and set the lease time on that. The server now has two queues, called int(1) and str("1"), which is both confusing, and also breaks the JSON when you call status again (you get '
"queues": {"1": {}, "1": {}}').This patch converts queue_id to str every time it is passed into the core functions of realms.py, with the result that queue IDs will now always be the string representation of whatever you pass in, and will be valid JSON keys.