1973 bug edit superhashlist bug in hashlist datasource#2057
Open
prettyaveragecoder wants to merge 2 commits intodevfrom
Open
1973 bug edit superhashlist bug in hashlist datasource#2057prettyaveragecoder wants to merge 2 commits intodevfrom
prettyaveragecoder wants to merge 2 commits intodevfrom
Conversation
added 2 commits
May 5, 2026 13:52
Contributor
|
How does this work when you are included multiple to many expands? Wont the last always overwrite the result? Personally I would say to solve this is to not load a pagesize for this in the frontend since pagination is not possible for the included section anyway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fix missing meta.page.total_elements in getOneResource for to-many includes.
Frontend got a TypeError when editing a superhashlist because
response.meta.page.total_elements was undefined in the API response.
Changes
when the request includes a to-many relationship (e.g. include=hashlists)
Known limitation
The current implementation counts total expanded objects across all to-many
relationships in a single value. This works correctly today because no
endpoint includes multiple to-many relationships simultaneously. If that
changes in the future, total_elements may return an incorrect combined count
and will need to be revisited.
Test
Added test_superhashlist_edit_returns_meta_page_total_elements in
test_hashlist.py to verify that meta.page.total_elements is returned
correctly when fetching a superhashlist with include=hashlists.
The test makes a direct HTTP request instead of using the hashtopolis
Python library, because the library only returns the deserialized data
object (response['data']) and discards the meta field. By using
requests.get() directly we get the raw JSON:API response and can assert
that meta.page.total_elements exists and has the correct value.