[FSSDK-11454] Swift - Add SDK Multi-Region Support for Data Hosting#606
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds multi-region support for data hosting in the Optimizely Swift SDK, allowing events to be sent to different regional endpoints based on configuration.
- Add Region enum with US and EU support to Project and ProjectConfig models
- Update event building and dispatching to include region information and use appropriate endpoints
- Modify user context creation to accept an optional region parameter
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| BatchEventBuilderTests_Region.swift | Comprehensive test suite covering region functionality for impression/conversion events |
| OptimizelyUserContext.swift | Add optional region parameter to user context initialization |
| OptimizelyUserContext+ObjC.swift | Update Objective-C wrapper to support region parameter with US default |
| BatchEventBuilder.swift | Include region information in event creation and encoding |
| ArrayEventForDispatch+Extension.swift | Add region validation to event batching logic |
| ProjectConfig.swift | Add computed property to get region with US default |
| Project.swift | Add Region enum and region field to Project model |
| EventForDispatch.swift | Add region-based endpoint selection and region parameter to initializer |
| BatchEvent.swift | Add region field to batch event structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pvcraven
previously approved these changes
Aug 25, 2025
pvcraven
left a comment
There was a problem hiding this comment.
Adds region support. Might want to add a test case for what happens if a country other than "US" and "EU" is specified.
…com/optimizely/swift-sdk into esra/FSSDK-11454_swift_data_hosting
Contributor
muzahidul-opti
left a comment
There was a problem hiding this comment.
Looks good to me. Added some suggestions.
muzahidul-opti
requested changes
Aug 29, 2025
Contributor
muzahidul-opti
left a comment
There was a problem hiding this comment.
Looks good, some cleanup suggested
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
Test plan
Issues