refactor: remove listing of posts in the show discussion endpoint #4067
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.
Changes proposed in this pull request:
There is a specific non-standard and unnecessary behavior that the code does (and has done since 2015), which is that the "show discussion" endpoint, also takes care of listing the posts with pagination
/api/discussions/101?page[offset]=0&page[limit]=20
/api/discussions/101?page[near]=41
This was particularly annoying to keep when we refactored the code to the new JSON:API implementation.
This PR gets rid of that, and instead loads the posts through a second request, which is what happens anyway if you are browsing the forum.
While this is an actually minor change, it is breaking in that extensions that add relationship includes to the "show discussion" endpoint like for example:
posts.mentions
, would need to stop doing so. That will be added to the documentation and the upgrade tool if possible.Important
This is not to be confused with the behavior of loading all post IDs in the "show discussion" endpoint, which is used by the scroll scrubber. That is a completely different thing. i.e linkage.
Necessity
Confirmed
composer test
).