feat(networking): add getWorkflows list endpoint#6853
Merged
Conversation
Port of RevenueCat/purchases-android#3509 Adds WorkflowSummary and WorkflowsListResponse models, GetWorkflowsListOperation, and WorkflowsAPI.getWorkflows() to support listing a subscriber's workflows via GET /v1/subscribers/{userId}/workflows. Includes request deduplication and background-aware delay, matching the existing getWorkflow(by id) pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Register the two new source files in the root RevenueCat.xcodeproj so xcodebuild (used by CI) can find them. SPM discovers them automatically but the tracked root project needs explicit file references and build file entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…point The getWorkflows endpoint does not send a type filter query parameter. The snapshots were created from an earlier design and needed to be updated to match the actual request URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eCase JSONDecoder.default uses .convertFromSnakeCase, which converts JSON keys to camelCase before matching against CodingKey raw values. The explicit CodingKeys had snake_case raw values (e.g. "display_name"), causing a mismatch since the decoder would convert display_name to displayName before the lookup. Removing the explicit CodingKeys lets Swift synthesize them with camelCase raw values, which correctly match the converted keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03263e2. Configure here.
…tness tests - Add optional `type: String?` parameter to `getWorkflows` path, operation, API method, and mock, matching Android PR #3509 which supports `?type=<value>` query filtering on the list endpoint - Include `type` in the operation deduplication cache key so calls with different types are not coalesced - Add `testGetWorkflowsWithTypePassesQueryParameter` with snapshots for all OS variants - Add `WorkflowSummaryDecodingTests` covering explicit-null `offering_id`, absent `prefetch` default, and unknown-field tolerance for both `WorkflowSummary` and `WorkflowsListResponse` - Remove unnecessary `import Foundation` from `WorkflowsListCallback.swift` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
approved these changes
May 27, 2026
vegaro
left a comment
Member
There was a problem hiding this comment.
We should make sure it uses signature verification before merging. Otherwise it looks good after a couple nits
…ache key separator and indentation - Move .getWorkflows to supportsSignatureVerification=true, matching .getWorkflow and Android PR (#3509) - Add "\n" separator between appUserID and type in individualizedCacheKeyPart to prevent collision - Fix indentation of factory closure closing brace and label to match GetWorkflowOperation pattern Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rickvdl
added a commit
that referenced
this pull request
May 28, 2026
…stTests (#6861) PR #6853 added getWorkflows list tests with snapshots for iOS 16-18, 26, macOS, tvOS, and watchOS, but omitted iOS 14 and iOS 15. The run-test-ios-15-and-14 CI job fails because swift-snapshot-testing finds no reference files for the 6 new testGetWorkflows* tests on those platforms. iOS 14/15 use StoreKit 1 (X-StoreKit-Version: 1, X-StoreKit2-Enabled: false), matching the pattern of existing iOS14/15 snapshots in this suite.
This was referenced Jun 3, 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.

Summary
Port of RevenueCat/purchases-android#3509
WorkflowSummary(id,displayName,offeringId?,prefetch) andWorkflowsListResponsemodels withCodable+HTTPResponseBodyconformancesGetWorkflowsListOperationandWorkflowsListCallbackforGET /v1/subscribers/{userId}/workflowsWorkflowsAPI.getWorkflows(appUserID:isAppBackgrounded:completion:)with in-flight request deduplication and background-aware delay (same pattern asgetWorkflow)BackendGetWorkflowsListTestscovering: HTTP call, background delay, request deduplication, response deserialization, network error, empty userID guardNotes
getWorkflowshassupportsSignatureVerification=falseandneedsNonceForSigning=false, matching Android (no signing for the list endpoint)getWorkflow(by ID) retainssupportsSignatureVerification=trueNote
Low Risk
Additive networking and models following existing workflow GET patterns; no purchase or identity logic changes. Reviewers should confirm list-endpoint signature/ETag flags match backend expectations (list is grouped with verified GET paths).
Overview
Adds client support for listing a subscriber’s workflows via
GET /v1/subscribers/{appUserID}/workflows, including an optionaltypequery filter.New
WorkflowSummary/WorkflowsListResponsemodels decode list payloads (withprefetchdefaulting tofalseand tolerant handling of unknown JSON keys).GetWorkflowsListOperationandWorkflowsListCallbackmirror the existing single-workflow fetch: cacheable in-flight deduplication keyed by user +type, emptyappUserIDshort-circuit, and background jitter delay.WorkflowsAPI.getWorkflowswires this throughHTTPRequest.Path.getWorkflows, with ETag and auth aligned to other subscriber GETs.Tests add
BackendGetWorkflowsListTests, decoding coverage,MockWorkflowsAPIstubs, and snapshot fixes so default list calls use/workflowswhiletype=paywallkeeps the query string.Reviewed by Cursor Bugbot for commit bb97ebf. Bugbot is set up for automated code reviews on this repo. Configure here.