Repository navigation
Read Chrome Web Store reviews - #31
Merged
Merged
Conversation
The reviews page carries its reviews as JSON for its scripts (AF_initDataCallback), each with a review ID, stars, text, version, last-edit time and the developer's reply. The page lists the 10 latest in its language, so every configured language (English and Portuguese) is one request. Chrome replies now count for the unanswered filter, like the Marketplace's.
|
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.



What
Until now,
ChromeWebStoreSource.fetchReviewsalways returned an empty list. The visible text of the reviews page has neither the stars nor a review ID, so the reviews couldn't be read from it./detail/{id}/reviewsalso carries its reviews as JSON for its own scripts, in anAF_initDataCallbackblock. Each review there has a stable ID, stars, text, the version reviewed, the last-edit time and the developer's reply. The block is located throughAF_dataServiceRequests: it is the request that asks for this item with a page size.hl). The newextpulse.stores.chrome-web-store-review-languagessetting is[en, pt]. Results are merged by review ID, newest first, up to 100.ListingNotFoundException(the page has no<h1>). A page without the data block, or a review that isn't the expected shape, is aStoreExceptioninstead of a guess.replied, like the Marketplace's. Open VSX still has no replies. The rule is the newStore.hasReplies().batchexecuteendpoint returns 100 reviews per call, but it is an undocumented API for the site's own scripts. The page is what any visitor gets. ADR 0009 explains this.Tests
ChromeWebStoreSourceTests: 9 new tests cover both languages merged and sorted, exact field values, a review listed in two languages counted once, ratings only, not found, a changed page, a review that isn't the expected shape, unreadable JSON, and an invalid ID.ReviewsApiTests: a new test checks Chrome replies inrepliedand inunanswered.LiveStoreTests: run against the real store, it now also reads AdBlock's reviews, and it passes../mvnw verifypasses: 175 tests and the coverage gate.