adobe / adobe/aepsdk-core-android

configureWithAppId does not refresh config in all scenarios (MOB-23309)

Open
#730 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
17
Forks
30
Avg merge
4h 12m
Merged PRs (30d)
4

Description

### Expected Behaviour
If I need to test with two app ids in the same session, I should be able to switch between the two multiple times within that same session.

e.g.
MobileCore.configureWithAppId(appId1) -> set appId1
MobileCore.configureWithAppId(appId2) -> set appId2
MobileCore.configureWithAppId(appId1) -> set appId1

### Actual Behaviour

MobileCore.configureWithAppId(appId1) -> set appId1
MobileCore.configureWithAppId(appId2) -> set appId2
MobileCore.configureWithAppId(appId1) -> still **appId2** ❗

### Reproduce Scenario (including but not limited to)
Issue seems to be caused by [this config expiry check](https://github.com/adobe/aepsdk-core-android/blob/main/code/core/src/main/java/com/adobe/marketing/mobile/internal/configuration/ConfigurationExtension.kt#L247C40-L247C56) which caches the first appId1 set date and does not account for this scenario.

You might also need to consider clearing the expiry cache on configureWithAppId(null / "")

#### Steps to Reproduce

#### Platform and Version
Android, Core/Config v3.2.0

#### Sample Code that illustrates the problem

#### Logs taken while reproducing problem

Contributor guide

Open the contributing guide

Research direction

Start in code/core/src/main/java/com/adobe/marketing/mobile/internal/configuration/ConfigurationExtension.kt around the linked config expiry check at line 247, then trace configureWithAppId calls. Verify switching appId1 to appId2 and back refreshes the active configuration, including configureWithAppId(null or ""). Done means repeated app-ID changes in one session select the requested configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.