fix: preserve requested review filter and add ReviewsBatch.next_batch#41
Open
Flummy1 wants to merge 1 commit into
Open
fix: preserve requested review filter and add ReviewsBatch.next_batch#41Flummy1 wants to merge 1 commit into
Flummy1 wants to merge 1 commit into
Conversation
Stamp the requested filter and user_id onto ReviewsBatch in GetReviews.transform_result, since FunPay omits the hidden filter/user_id inputs in some responses. Add ReviewsBatch.next_batch() to paginate while preserving the filter, mirroring the transactions pagination fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Что и зачем
В пагинации отзывов было два пробела по сравнению с транзакциями:
Нет метода
next_batch(). ВReviewsBatchуже лежали все данные дляпагинации (
next_review_id,filter,user_id), но не было способазапросить следующую страницу.
Тот же баг с расширением фильтра, что и в транзакциях (fix: preserve requested transaction filter across pagination #40). FunPay в
части ответов
users/reviewsне отдаёт скрытые инпутыfilterиuser_id,поэтому
ReviewsParserсчитывает для нихNone. Любая пагинация, опирающаясяна спарсенное значение, молча теряла запрошенный фильтр по звёздам и id
профиля.
Изменения
GetReviews.transform_resultтеперь штампует в батч запрошенныеfilterи
user_id, перекрывая ненадёжные спарсенные значения — тот же подход, что иу
GetTransactionsв fix: preserve requested transaction filter across pagination #40.ReviewsBatch.next_batch():ValueError('Last batch.'), еслиnext_review_idпуст;ValueError('Unknown user id.'), еслиuser_idнеизвестен (вотличие от транзакций, отзывам нужен явный
user_idдля пагинации);filterв следующий запрос.