yegor256/netbout

cache of CdFriend not cleared

Closed this issue · 31 comments

When someone changes his email all bouts sends notifications to his old email until the cache of CdFriend will be expired(up to 5 hours). It looks like a bug for me.
If the email changed for an alias the CdFriend's cache also should be cleared

There is failed netbout-client test as well

Failed tests:
  RtAliasITCase.updateAndRetrieveEmail:62
Expected: is "alias317800815@example.com"
     but: was "alias1144935927@example.com"

@karato it's a valid bug

@karato it's a valid bug

@dmzaytsev tag "bug" added

@dmzaytsev milestone set to 3.1 (correct me if I am wrong)

@dmzaytsev thanks for tis bug, I topped your account for 15 mins, transaction 60849495

@dimonn12 this task is yours, please help (see our key principles of work). If you have any technical questions, don't hesitate to ask right here

The cost of this task is 30 mins (this is exactly how much will be paid, not less not more), when the task is done

@karato this is postponed

@karato this is postponed

@dmzaytsev got it, "postponed" label here

@karato this is postponed

@dmzaytsev I will try to find someone else

@karato this is not postponed anymore

@karato this is not postponed anymore

@dmzaytsev OK, I un-labeled it as "postponed" tag

@karato this is urgent

@karato this is urgent

@dmzaytsev sure, thanks, I added "urgent" label to it

@dimonn12 this ticket is yours now, please proceed, and keep in mind this. Any technical questions you should ask right here... The budget of this issue is 30 mins, which is exactly how much will be paid when the task is done (see this for explanation)

@dimonn12 you've been working with this task for too long. I'm sorry, but I'll assign someone else. Please stop working with it. See our no obligations principle. added -60 to your rating, now it is equal to -240

@mkordas this is your task

@dmzaytsev how can I refer from CdAlias to CdFriend? They do not have any reference to each other. Moreover, I don't see any possibility to clear cache from outside of the class.

@mkordas I believe we shouldn't use jcabi Cacheable in this case, because each alias contains own cache of its friends now. So an alias can clear only own cache. thus we need to use a shared cache instead.
Let's introduce a new class, say named SharedCache in com.netbout.cached
This class should contains a map of google guava cache instances, names(parameters) of instances will be passed in a constructor(or maybe in #add() method). SharedCache will be created in com.netbout.Launch#main() and passed as constructor parameter to CdBase and then to all Cd-classes when needed. So we need this class at least in CdAlias and CdFriends.

I would suggest to start from the implementation of SharedCache and unit tests and create a puzzles for other job

names(parameters) of instances will be passed in a constructor(or maybe in #add() method)

@dmzaytsev are you sure about the above? Do we really need map of caches? I think we just need one shared cache right now.

@mkordas we have at least one more case where we could use instance SharedCache instead of removing Cacheable annotation
#811

@karato I need more time here

@dmzaytsev how would you like to achieve type-safety in such shared cache? Each cache may contain mappings between different things.

@karato I need more time here

@mkordas OK, no problem, take your time

@karato please assign someone else

@karato please assign someone else

@mkordas -30 points to your rating

@karato please assign someone else

@mkordas I will assign somebody else to this issue

@karato this is postponed

@karato this is postponed

@dmzaytsev thanks, I added "postponed" label

@karato this is postponed

@dmzaytsev right, I removed "urgent" tags

@karato this is postponed

@dmzaytsev I will ask somebody else to pick this up