-
Notifications
You must be signed in to change notification settings - Fork 4
Improve dependency list data fetching #1674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: listing-version-cleanup
Are you sure you want to change the base?
Conversation
Content moderators currently reject packages by marking the PackageListing object rejected. PackageListings are community-scoped. Some of the endpoints are package scoped, i.e. they are not related to any communities or listings. These endpoints therefore currently have no way of telling if a package has been rejected or not. In worst case, the rejected packages can contain malware, so under no circumstances do we want to show such packages on the website where unsuspecting users can be tricked to download the mods. Therefore the pages of the website that use such endpoints are disabled until we figure out how to address the problem. Since the old website doesn't have unscoped endpoints, from feature parity perspective the new one doesn't need to have them either. Footgun warning: the website still uses some endpoints that are not community-scoped, such as "get README for this version of the package". This is fine as long as the page where the data is shown takes measures to ensure the content can be shown by querying the package listing endpoint too and showing 404 error if the package is rejected.
- The only difference between the components was that one expected the
route to contain communityId which is used to fetch the latest
version number, while the two other expected packageVersion to be
included in the URL. Loaders can easily check the route params and
serve both cases
- We may want to do something similar to readme and versions
components that also exist in triplicate
- The part of the code that fetches the package listing details when
packageVersion is not provided by the URL now uses the same approach
as the PackageListing component does. This fixes an issue where the
tab would show 404 when viewing a rejected package's dependencies,
even if the user was authententicated and had permissions to view it
- React-router uses the component name as the default id, but since we
have multiple routes for the same component, we need to define ids
manually
- Parent route PackageListing and sub route Required both request package listing data from backend - Using the recently added juiced up Dapper instance, multiple request to same endpoint with same arguments withing a request are deduplicated - Technically this doesn't help in packageListingVersion. While it makes the request, its sub route doesn't since it has the required data available as URL parameter. I decided to change the parent route to use the deduplicating Dapper version anyway for consistency's sake
WalkthroughThis PR refactors package listing and version loaders to use request-scoped Dapper instances via Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2025-12-09T12:41:16.448ZApplied to files:
📚 Learning: 2025-12-09T12:41:16.448ZApplied to files:
🧬 Code graph analysis (3)apps/cyberstorm-remix/app/p/packageListingVersion.tsx (3)
apps/cyberstorm-remix/app/p/packageListing.tsx (2)
apps/cyberstorm-remix/app/p/tabs/Required/Required.tsx (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## listing-version-cleanup #1674 +/- ##
===========================================================
+ Coverage 11.65% 11.73% +0.08%
===========================================================
Files 322 320 -2
Lines 22963 22796 -167
Branches 511 509 -2
===========================================================
Hits 2676 2676
+ Misses 20287 20120 -167 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
FYI @VilppeRiskidev 7aa6c26 contains an example of deduplicating requests made by stacked routes (only for clientLoaders currently). |
No description provided.