handle superseded messages properly for incremental mode in GetThreadNonblock CORE-8523 #13249
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.
There is a problem in the
INCREMENTAL
mode ofGetThreadNonblock
where it does not include messages in the remote result that were modified (by a superseder) from the cached result. This affects edits and deletes of messages that we have cached. Patch does the following to fix the situation:1.) Change
mergeLocalRemoteThread
to include messages from the remote result that have aSupersededBy
value that is different than what we sent up for the cached result.2.) Fix how
resolveHoles
works inHybridConversationSource
. Previously, it would try to modify the thread that we fetched from storage in-place. However, it didn't do anything for superseded messages, and so the results we got back from a "holey" cache hit were wrong. Now instead of modifying the thread inresolveHoles
, we just re-fetch fromStorage
if we get a holey hit and resolve it.3.) Add a new mode for
basicSupersedesTransform
to include a "hidden"PLACEHOLDER
message instead of just dropping the message for deleted messages. This allows us to communicate to clients ofGetThreadNonblock
that cached messages have actually been deleted.4.) Bonus Fix:
PullLocalOnly
had previously been using aSimpleResultCollector
regardless of the query passed in. This made it such that it returned a subset of whatPull
would when given the same query. Change this to use aResultCollector
derived from the query.cc @buoyad