Skip to content

Add items param to trackRecommendationResultsView for variation ID su… - #277

Merged
evanyan13 merged 5 commits into
masterfrom
cdx-459-swift-sdk-support-passing-variationids-in
Jul 6, 2026
Merged

evanyan13 merged 5 commits into
masterfrom
cdx-459-swift-sdk-support-passing-variationids-in

Conversation

@Sher-Bakhodirov

Copy link
Copy Markdown
Contributor

Summary

Adds an items: [CIOItem]? param to trackRecommendationResultsView so callers
can pass variationIDs. Mirrors trackBrowseResultsLoaded; items is preferred over
customerIDs when both are set. Backwards-compatible.

Why one method, not two overloads

A separate items: overload would be ambiguous — with defaults on every param,
calls omitting both customerIDs and items (e.g.
trackRecommendationResultsView(podID:)) fail to compile. A single method
matches trackBrowseResultsLoaded and stays backwards-compatible.

@Sher-Bakhodirov
Sher-Bakhodirov requested a review from a team as a code owner June 12, 2026 15:58
Copilot AI review requested due to automatic review settings June 12, 2026 15:58
constructor-claude-bedrock[bot]

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the public tracking API for recommendation result views to accept full CIOItem objects (enabling variationID support) while preserving the existing customerIDs path for backwards compatibility. It mirrors the established items behavior used by other tracking endpoints (e.g., browse/search results loaded), including preferring items over customerIDs when both are provided.

Changes:

  • Add items: [CIOItem]? parameter to ConstructorIO.trackRecommendationResultsView.
  • Extend CIOTrackRecommendationResultsViewData to serialize items (including variation_id and sponsored listing fields) and prefer it over customerIDs.
  • Add/extend unit tests to cover items payload serialization and precedence.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
AutocompleteClient/FW/Logic/Worker/ConstructorIO.swift Adds items parameter to the public tracking API and updates docstring usage example.
AutocompleteClient/FW/Logic/Request/CIOTrackRecommendationResultsViewData.swift Adds items to request data and serializes it into the items payload (preferred over customerIDs).
AutocompleteClientTests/FW/Logic/Worker/ConstructorIOTrackRecommendationResultsViewTests.swift Adds a call-site test ensuring the method accepts items without breaking existing behavior.
AutocompleteClientTests/FW/Logic/Request/TrackRecommendationViewRequestBuilder.swift Adds payload-focused tests for items, sponsored listing fields, and items > customerIDs precedence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AutocompleteClient/FW/Logic/Worker/ConstructorIO.swift Outdated
constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

constructor-claude-bedrock[bot]

This comment was marked as outdated.

@constructor-claude-bedrock constructor-claude-bedrock Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR correctly adds items: [CIOItem]? to trackRecommendationResultsView, mirroring the existing trackBrowseResultsLoaded / trackSearchResultsLoaded pattern, and the serialization logic, test renames, and new test coverage are all solid.

Inline comments: 5 discussions added

Overall Assessment: ⚠️ Needs Work

Comment thread AutocompleteClient/FW/Logic/Worker/ConstructorIO.swift
Comment thread AutocompleteClient/FW/Logic/Worker/ConstructorIO.swift
Comment thread AutocompleteClient/FW/Logic/Worker/ConstructorIO.swift

@evanyan13 evanyan13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you @Sher-Bakhodirov for working on the changes 💯
Have made some updates to align with current documentation format

@evanyan13
evanyan13 merged commit 95b19e4 into master Jul 6, 2026
3 checks passed
@evanyan13
evanyan13 deleted the cdx-459-swift-sdk-support-passing-variationids-in branch July 6, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants