-
Notifications
You must be signed in to change notification settings - Fork 0
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
Search ecosystem split #53
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update @karamba228 - I've added a few more comments
// import { maturityColor, maturityIconPath } from "@/components/Maturity"; | ||
// import { riskColor, riskIconPath } from "@/components/Risk"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments
@@ -4,9 +4,10 @@ import { NextRequest } from "next/server"; | |||
export async function GET(request: NextRequest) { | |||
const searchParams = request.nextUrl.searchParams; | |||
const query = searchParams.get("query"); | |||
const ecosystem = searchParams.get("ecosystem") || ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will fail with ""
will it not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we are using this file anymore. It looks to be handling package search within the API
src/utils/search_conda.ts
Outdated
} catch (error) { | ||
const errorMessage = | ||
error instanceof Error ? error.message : "An unknown error occurred."; | ||
toast.error(`Error fetching data from Anaconda.org: ${errorMessage}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested this toast? can you send a screenshot? it looks like it is running on the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, toast does not work server side, I tried propagating the error up to the client side page but the error does not propagate with debounce: lodash/lodash#4449. I looked into the suggested solution and tried implementing that but the error would not propagate: lodash/lodash#4815 (comment)
src/utils/search_npm.ts
Outdated
const errorMessage = | ||
error instanceof Error ? error.message : "An unknown error occurred."; | ||
toast.error(`Error fetching data from npm registry: ${errorMessage}`); | ||
throw new Error(`Error fetching data from npm registry: ${errorMessage}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you throwing a new error here?
throw new Error(`Error fetching data from npm registry: ${errorMessage}`); | |
throw error; |
how is this coming along? |
@srossross I am blocked with debounce not allowing the propagation of the error to the client side component for the toast to work properly. Retrieving packages from each respective api should work now. I mentioned the block in the previous comment with references to issues I have researched #53 (comment) |
Weird behavior. the search seems to prioritize Pypi no matter what.
For example, I am using pandas to test pypi and conda packages:
If


pypi
is selected and I search for "Pandas" the results show up as expected. But if I selectcoda
for the ecosystem and search for "Pandas" the same output is generated.Where the differences start to appear is if I select


pypi
and search for conda/pandas, pypi results are prioritized. likewise, if I search for conda/pandas with conda ecosystem selected, conda results show up at the top of the list.