-
Notifications
You must be signed in to change notification settings - Fork 4
Fix hardcoded frontend URL in content.tsx #22
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: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @onlineinfoh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where the extension was consistently redirecting users to a development server due to a static, hardcoded URL. By introducing an environment variable for the frontend URL, the change ensures that the extension dynamically points to the correct, configured frontend instance, thereby enhancing the application's flexibility and preventing incorrect redirections for users. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly replaces a hardcoded frontend URL with an environment variable, improving configurability. However, I've identified a potential issue where the link could become broken if the environment variable is not set. I've provided a suggestion to make the code more robust by handling this case.
| <span className="text-blue-600"> | ||
| <a | ||
| href={`https://mantisdev.csail.mit.edu/space/${spaceId}/`} | ||
| href={`${process.env.PLASMO_PUBLIC_FRONTEND}/space/${spaceId}/`} |
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.
While using an environment variable is a great improvement to remove the hardcoded URL, there's a potential issue if PLASMO_PUBLIC_FRONTEND is not set. In that case, process.env.PLASMO_PUBLIC_FRONTEND will be undefined, and the resulting URL will be something like undefined/space/..., which is a broken link.
To make this more robust, I suggest adding a check for the environment variable. If it's not present, we can fall back to a safe value like '#' to prevent a broken link. This provides a better user experience than a link that leads to an error page.
| href={`${process.env.PLASMO_PUBLIC_FRONTEND}/space/${spaceId}/`} | |
| href={process.env.PLASMO_PUBLIC_FRONTEND ? `${process.env.PLASMO_PUBLIC_FRONTEND}/space/${spaceId}/` : '#'} |
- Replace 'import { v4 as uuidv4 } from uuid' with 'import { getUuidV4 } from driver'
- Replace all uuidv4() calls with getUuidV4() in LinkedIn connection
- Fixes 'Cannot find module crypto' error in browser environment
- Uses browser's native crypto.randomUUID() API instead of Node.js package
This PR fixes a hardcoded URL in the extension that was causing spaces to always redirect to the dev server instead of the configured frontend instance.