Skip to content

Commit

Permalink
fix: Kit Initialization & De-Initialization. (#398)
Browse files Browse the repository at this point in the history
Fix for Kit Initialization & De-Initializationg.
Underlying issues is calling fetchConfig when no kit instance is assigned to KitFrameworkManager, therefore the because the instance is null, we cant pass the kits to to apiClient.
Removing empty validation in ConfigManager since this is a valid case.
  • Loading branch information
markvdouw authored Jul 5, 2023
1 parent 49b9066 commit 42560f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,10 @@ void saveConfigJson(JSONObject coreConfig, JSONArray kitConfig, String etag, Str
.putString(Constants.PrefKeys.ETAG, etag)
.putString(Constants.PrefKeys.IF_MODIFIED, lastModified)
.apply();
if (kitConfigString == null || (kitConfigString != null && !kitConfigString.isEmpty())) {
getKitConfigPreferences()
.edit()
.putString(KIT_CONFIG_KEY, kitConfigString)
.apply();
}
getKitConfigPreferences()
.edit()
.putString(KIT_CONFIG_KEY, kitConfigString)
.apply();
} else {
Logger.debug("clearing current configurations");
clearConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void loadKitLibrary() {
KitManager kitManager = constructor.newInstance(mContext, mReportingManager, mCoreCallbacks, mOptions);
JSONArray configuration = mCoreCallbacks.getLatestKitConfiguration();
Logger.debug("Kit Framework loaded.");
this.mKitManager = kitManager;
if (!MPUtility.isEmpty(configuration)) {
Logger.debug("Restoring previous Kit configuration.");
kitManager
Expand All @@ -81,7 +82,6 @@ public void loadKitLibrary() {
}
);
} else {
mKitManager = kitManager;
updateDataplan(mCoreCallbacks.getDataplanOptions());
}
} catch (Exception e) {
Expand Down

0 comments on commit 42560f1

Please sign in to comment.