fix: [SDK-5181] accept a create-subscription success with no subscription object - #1748
Merged
Merged
Conversation
…tion object - Hydrate the model only when the response carries a subscription object. A 2xx without one is the server's no-op for a subscription that already exists on this user, so it is logged at INFO instead of ERROR - Read ryw_token and ryw_delay from the top level of the response, where the server sends them, instead of from inside the subscription object - Add SubscriptionCreateResponseTests covering both cases
nan-li
force-pushed
the
nan/sdk-5181
branch
from
September 18, 2026 15:32
5b4b773 to
2a43bdf
Compare
abdulraqeeb33
approved these changes
Sep 18, 2026
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
Approve with nits.
- The no-subscription test still passes if the executor hunk is reverted. Assert RYW record/resolve so revert goes red.
- INFO is right for a missing
subscriptionkey. Same line also fires when the value is present but not a dict, and default remote logging will not export INFO.
…reverted - Register a never-met waiter on the IAM fetch condition in the no-op test and assert the executor's resolve releases it, which the old early return never did
18 tasks
Merged
This was referenced Sep 18, 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.
Description
One Line Summary
Stop logging an error when the server answers a create-subscription request with a success that has no subscription object.
Details
Motivation
The server answers this way when the email or SMS being added already belongs to the user. The SDK logged it as an error on every occurrence even though nothing went wrong.
Scope
ryw_tokenandryw_delayfields are read from the top level of the response, where the server puts them, instead of from inside the subscription object where they never were.Testing
Unit testing
Two tests in
SubscriptionCreateResponseTests: a success without a subscription object completes once without changing the model, and a success with one sets the subscription id and records the token and delay.Manual testing
Both tests plus
SubscriptionUpdateRaceTestsrun locally on an iPhone 17 Pro simulator.Ran on device and added an existing email and got a 200 response and the SDK logged "INFO: Create Email subscription response has no subscription object to hydrate"
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code