SAP / gigya-android-sdk

SAP CDC (Gigya) android sdk for mobile
Apache License 2.0
19 stars 13 forks source link

Uncleared state after logout causes caching problem #15

Closed tranquvis closed 3 years ago

tranquvis commented 3 years ago

Hi

I am facing the following bug at gigya-android-sdk-core v5.0.0 .

Scenario:

  1. I have an account with a language set.
  2. I logout by calling Gigya.logout .
  3. I login again by calling Gigya.login (application not closed before) .
  4. After successfull login, I want to fetch the full account object including the languages field with Gigya.getAccount and extraProfileFields set to "languages".
  5. I expect to receive the languages but I don't, because the cached account object was used.

The reason for this bug seems to be that not the full state is cleared on logout. On logout cachedAccount in accountCacheService is cleared, but the fields _lastRequestedInclude and _lastRequestedProfileExtraFields are not cleared. Gigya.login updates cachedAccount, but does not update _lastRequestedInclude and _lastRequestedProfileExtraFields. Consequently Gigya.getAccount has the wrong information about the cached object.

Regards, Andreas

tal-mi commented 3 years ago

Hi,

Issue has been reported and will be resolved in the upcoming core release.

Regards, Tal

tal-mi commented 3 years ago

Hi,

_lastRequestedInclude & _lastRequestedProfileExtraFields were removed in version 5.1.0. You are now able to use the account configuration settings in order to set a default include, extraProfileFields for your app. The account caching will rely on it. In order to clear the cache please use one of the avilable getAccount interfaces with invalidateCache options.