Don't reload event by UID if already in memory. #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't reload an existing incidence from DB.
Either the calendar is already in sync with
the calendar or the database has been externally
modified and in that case, the calendar has been
emptied.
Testing the parent incidence in case of recurring
incidence should be enough to guarantee the
existence of all exceptions since the load
methods ensure loading of whole series.
@pvuorela, tests are passing and this PR follow the same spirit as the one introducing the caching for ranges, meaning that there is no point in reloading if we assume that the calendar is in sync with the DB. It is a minor optimisation that should not cost too much in term of maintainablity. It may not be so minor though for search cases where there could be large quantity of events to load by UIDs.