Repository navigation
Conversation
The server wants subscriptions keyed by HumanUser id (the shape
user_subscriptions_read returns), but the method sent {"users": [...]},
so every call failed. Fixes shotgunsoftware#463.
Also corrects the user_subscriptions_read docstring, and adds tests for
both methods.
VFXMystic
marked this pull request as ready for review
November 11, 2026 19:07
Author
|
re the red checks: they're the fork-secrets thing, not this change. Every test job fails with base_url must use http or https got '$(ci_site)', because the pipeline doesn't get the site variables on PRs from forks. That also takes out the mocked tests in test_client.py, since SG_SERVER_URL overrides the test config. On master with SG_SERVER_URL='$(ci_site)', test_client.py fails all 31 tests. On this branch with it unset, all 34 pass, including the 3 new ones. Style, typing and docs are green. |
This branch has not been deployed
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.
Fixes #463.
The server wants subscriptions as a dict keyed by HumanUser id, which is exactly what
user_subscriptions_readhands back.user_subscriptions_createwas sending{"users": [...]}instead, so every call failed withInvalid humanUserId users. It now builds the keyed dict from the same list argument as before, so the signature doesn't change.The old return check (
response.get("status") == "success") could never pass: the server doesn't send astatuskey, and_call_rpcalready raises on errors. It now returnsTruewhen the server answers. I don't know what the per-userNonevalues in the response mean, so I didn't try to interpret them.While I was in there, I fixed the
user_subscriptions_readdocstring and return type. It returns a dict keyed by user id, not a list.One thing to flag:
user_subscriptions_createused to raise on every call, and now it actually assigns subscriptions.Testing
tests/test_client.pycover the request each method sends, and whatuser_subscriptions_createreturns. These methods had no tests before.tests/test_client.pypasses on Python 3.9 and 3.13. (test_transform_dataneedsTZ=UTCon a machine outside UTC, with or without this change.)pre-commit run --all-filespasses, and flake8 has nothing new to say.True, anduser_subscriptions_readwas unchanged afterwards.