-
Notifications
You must be signed in to change notification settings - Fork 545
SpiceManager.getDateOfDataInCache doesn't work as expected #128
Comments
Although our tests was passing properly I edited our code for explicitely checking if the cache file exists. If you can try building RS from source your feedback would be appreciated. |
@Bobby-Jackson We need some feedback from you. @rciovati I assigned this issue to you so that you can feel free to close it and related issues and pull requests. |
Hi, I would like to but how can I build RS from the source? Any guide over there? |
@Bobby-Jackson here you are the instructions :) git clone [email protected]:octo-online/robospice.git
cd robospice
git checkout master
mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dfindbugs.skip=true -Dcheckstyle.skip=true -Dandroid.dex.optimize=false And then in your project replace your current RS version with |
I personally prefer mvn clean install and keep all checks on. Snapshots on sonatype include latest changes if you wanna try them. @riccardo can't you deploy snapshots ? Are you missing any password / key ? S.
|
On my machine (mbp with i5, 8gb ram and ssd) the whole process takes about 10minutes, for this reason I suggested the command to skip tests and checks which IHMO are not needed at this stage. Actually I never tried to deploy snapshots, maybe I will give it a try. |
Hi guys, I haven't got time yet to test the first bullet point but I have further information about the second one:
This error also happens with My test case: I have a listview inside a fragment and a refresh button. When i click on the refresh button I want to load data over the network so I clear cache and call execute
This working fine except when I open a skill (details view) and come back to my list (only onStart() and onResume() are called). Now, if I click to the refresh button, I can't figure out why (same reason?) so I decided to surround
Boum. This working fine except when I open a skill (details view) and come back to my list (only onStart() and onResume() are called). If I click to the refresh button, |
When coming back from my details view (or locking screen for instance) and hitting the refresh button, as I said before, the removeDataFromCache doesn't work. I looked at the logs and the only difference I saw was the binding step. This doesn't appear...
|
stephanenicolas commented
This issue has been resolved with Thank you. |
If I understand everything here, the issue can be closed. |
I'm sorry for not being very clear. I had two issues (two bullet points in the first message). The first one is solved with 1.4.6-SNAPSHOT but the second is pending (you can get more information in my following messages). I can open a new issue for the second issue if you want to. |
It's strange, the following test works fine since the introduction of this feature (from SpiceManagerTest) : public void test_getDateOfDataInCache_when_there_is_no_data_in_cache() throws InterruptedException, SpiceException, ExecutionException, TimeoutException {
// given
// we use double to get some in memory cache implementation
spiceManager.start(getInstrumentation().getTargetContext());
spiceManager.removeDataFromCache(TEST_CLASS, true);
// when
// test
assertNull(spiceManager.getDateOfDataInCache(TEST_CLASS, TEST_CACHE_KEY).get(SPICE_MANAGER_WAIT_TIMEOUT, TimeUnit.MILLISECONDS));
} |
I have also this problem with:
and maybe more methods from the SpiceManager. I'm pretty sure that comes from the same point: a binding problem. My test case again: A fragment that uses
in Now after getting my result successfully once, I lock my screen, unlock it and when coming back to the fragment (for instance), I try to refresh my data using some of the above methods and they don't work at all I noticed these logs are missing whereas they appear when it works (refreshing before unlocking screen):
|
Hi Mathieu, Does it still happen with 1.4.6-snapshot ? S.
|
Please see my message above on GitHub (#128 (comment)), I updated my message to be more accurate. So yes, it still happen with 1.4.6-snapshot.
|
I managed to reproduce this issue with the I guess it will be easier for you, the RS team, to figure this tough bug out :-) Here's the code: I just add some code to the
What I want to achieve, it will work in some cases:
You can see the logs that prove it worked!
But now, a way to reproduce the bug:
Hope it helps, |
Bug is reproduced, thanks for this @Bobby-Jackson . I am working on that bug. |
Thanks @Bobby-Jackson , that was a good one. A change introduced in 1.4.5 prevented the spiceManager from being restarted. The life cycle you proposed showed that pretty well. A bug fix is pending, a snapshot should be released within a few minutes to correct the bug. Can you confirm it, please ? |
Personal note : TODO : add a test to stop and restart a spicemanager. Don't close the issue until it's done. |
Bug is fixed, thanks a lot Stephane! This one drove me nuts! |
Test added in commit 5d049b1. Thanks for reporting it. That has been a real regression ! |
This post follows on from this issue
That's about
getDateOfDataInCache
removeDataFromCache(clazz, cacheKey)
,getDateOfDataInCache(clazz, cacheKey).get()
returnsThu Jan 01 01:00:00 UTC+01:00 1970
instead of the expectednull
.NullPointerException
on runninggetDateOfDataInCache(clazz, cacheKey)
Please take note that's happened prior to calling
get()
The text was updated successfully, but these errors were encountered: