Fixed
Details
Details
Assignee
James Wennmacher
James Wennmacher(Deactivated)Reporter
James Wennmacher
James Wennmacher(Deactivated)Fix versions
Priority
Created April 4, 2013 at 8:11 PM
Updated March 1, 2016 at 11:44 PM
Resolved August 28, 2013 at 9:15 PM
Add the folderName to AccountSummary. Include it in the Services check that validates if the data returned from the DAO is adequate.
Services how has something like
// NB: Now we must make sure we return the right
// AccountSummary based on all the parameters, not just the ones
// annotated with @PartialCacheKey on fetchAccountSummaryFromStore.
if (rslt.getMessagesStart() != start || rslt.getMessagesMax() != max) {
1) CacheKey should remain username+mailAccount. I don't think folder, start, or max should be included in the cache key (folderName is arguable though – though changing folders currently does force-refresh on getAccountSummary). Having folderName in AccountSummary allows verification that you are providing the info the user requested and not a different folder (though as previously mentioned it wouldn't happen since folder change forces cache flush – but the interface shouldn't assume UI works a certain way).
2) Move above check into the Dao after retrieving item from cache. Remove cache annotation parameters from signature and have Dao method manage the cache and validation check internally. Service should not need to know about the dao's internals including caching.
3) remove clearCache from interface. Add refresh as accountSummary parameter.
4) Current code puts folder name into preferences each time. I don't think that is what a user wants. If I look at my SentItems folder and sign out of the portal, I wouldn't expect the portal to show me my SentItems folder next time I log in. As is the summary mode shows information for SentItems which is confusing and not likely what you want. See https://apereo.atlassian.net/browse/EMAILPLT-121#icft=EMAILPLT-121 also.