Skip to content

Commit

Permalink
fix: improper way of handling customContext (#239)
Browse files Browse the repository at this point in the history
* fix: improper way of handling customContext

* ci: delete .github folder

* Revert "ci: delete .github folder"

This reverts commit 45fdd50.

* ci: set XCode v13 for build and quality check in v2 SDK
  • Loading branch information
1abhishekpandey authored Jan 20, 2023
1 parent 4bcaf61 commit 7a91754
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build-and-quality-checks-v2.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
name: Code Quality Checks(v2)
on:
pull_request:
branches: ['master-v2', 'develop-v2']
types: ['opened', 'reopened', 'synchronize']
branches: ["master-v2", "develop-v2"]
types: ["opened", "reopened", "synchronize"]

jobs:
build:
name: Code Quality Checks(v2)
runs-on: macOS-latest

steps:
- name: Checkout source branch
uses: actions/checkout@v3

- name: Install xcpretty
run: gem install xcpretty

- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_13.2.1.app/Contents/Developer'

- name: Build SDK(iOS)
run: |
xcodebuild build -scheme RudderSDK-iOS -workspace Rudder.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty
- name: Build SDK(watchOS)
run: |
xcodebuild build -scheme RudderSDK-iOS -workspace Rudder.xcworkspace -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 - 45mm' | xcpretty
- name: Build SDK(tvOS)
run: |
xcodebuild build -scheme RudderSDK-iOS -workspace Rudder.xcworkspace -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty
- name: Build SDK(macOS)
run: |
xcodebuild build -scheme RudderSDK-iOS -workspace Rudder.xcworkspace -destination 'platform=macOS,variant=Mac Catalyst' | xcpretty
- name: Install Cocoapods
run: gem install cocoapods

- name: Execute pod lint
run: pod lib lint --no-clean --allow-warnings
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Rudder (2.2.4)
- Rudder (2.2.5)

DEPENDENCIES:
- Rudder (from `.`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "."

SPEC CHECKSUMS:
Rudder: 5fb72ab3d09de72cab0a949aa7b1aad2f24947f9
Rudder: decdbd805872e80089665333f9752c8ed317c99d

PODFILE CHECKSUM: ee379229e6a0b60bc98226700ace2de002171547

Expand Down
7 changes: 4 additions & 3 deletions Sources/Classes/Client/Plugins/RSContextPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,19 @@ class RSContextPlugin: RSPlatformPlugin {
}

func insertDynamicOptionData(message: RSMessage, context: inout [String: Any]) {
/// First priority will given to the `option` passed along with the event
if let option = message.option {
if let externalIds = option.externalIds {
context["externalId"] = externalIds
}
if let customContexts = option.customContexts {
for key in customContexts.keys {
context[key] = [key: customContexts]
for (key, value) in customContexts {
context[key] = value
}
}
}
// TODO: Fetch `customContexts` set using setOption API.
}

}

extension RSClient {
Expand Down

0 comments on commit 7a91754

Please sign in to comment.