Skip to content

Commit

Permalink
fix: Loading cached user data before IAM sdk initialization (SDKCF-6826)
Browse files Browse the repository at this point in the history
chore: modified test case to satisfy the updated logic for registerPreference

chore: updated changelog (SDKCF-6826)
  • Loading branch information
SoumenRautray committed Oct 30, 2023
1 parent c4b350b commit 86528a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
- Added device_id to DisplayPermission request header [SDKCF-6624]
- Prevent calling `configure()` then RMC module is integrated [SDKCF-6710]
- Added rmcsdk version parameter to all api calls [SDKCF-6709]
- Retaining API calls until configure() is called [SDKCF-6812]
- Improvements:
- Retaining API calls until `configure()` is called [SDKCF-6740]
- Retaining API calls until configure() is called [SDKCF-6812]
- Fixes:
- Fixed Xcode 15 beta errors [SDKCF-6692]
- Fixed Finding RMC Bundle [SDKCF-6751]
- Fixed Loading cached user data before IAM initialisation [SDKCF-6826]
### 8.0.0 (2023-06-21)
- **Breaking changes:**
Expand Down
3 changes: 3 additions & 0 deletions Sources/RInAppMessaging/InAppMessagingModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ internal class InAppMessagingModule: ErrorDelegate, CampaignDispatcherDelegate,
accountRepository.setPreference(preference)

guard isInitialized else {
if accountRepository.updateUserInfo() {
campaignRepository.loadCachedData()
}
return
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests/InAppMessagingModuleSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ class InAppMessagingModuleSpec: QuickSpec {
expect(accountRepository.userInfoProvider).to(beIdenticalTo(aUser))
}

it("will not call checkUserChanges()") {
it("will call updateUserInfo() to update cached user data") {
iamModule.registerPreference(aUser)
expect(accountRepository.wasUpdateUserInfoCalled).to(beFalse())
expect(accountRepository.wasUpdateUserInfoCalled).to(beTrue())
}
}
}
Expand Down

0 comments on commit 86528a0

Please sign in to comment.