Enhancement: only include correspondent 'last_correspondence' if requested #6792
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.
Proposed change
After reading the linked issues, I wondered if the annotation query to pull out 'last_correspondence' is unnecessarily slowing things down. Im not really sure how to test other than asking the users (at least one seems briefly to confirm so far) but I think this would still be an improvement for all users (e.g. faster) and we only use
last_correspondence
in one place currently (I think), in the list of correspondents, in which case the records are paginated already.I suppose there's the question of whether this qualifies as a breaking change as getting the value in a list of correspondents would now require passing
last_correspondence=true
. As always welcome any thoughts in general or of course if I'm missing anything.Note: the changes to document-detail here are just a side-effect of this, we previously used the presence of
last_correspondence
on an object to check what type it was, but didnt actually use it there. That is significantly cleaner now anyway.Closes #6782 (and perhaps relevant to #4872?)
Type of change
Checklist:
pre-commit
hooks, see documentation.