Skip to content

Conversation

@onlineinfoh
Copy link
Contributor

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Hardcoded URL Fix: Replaced a hardcoded development server URL in src/content.tsx with a dynamic environment variable (process.env.PLASMO_PUBLIC_FRONTEND).
  • Dynamic Frontend Redirection: Ensures that space redirections within the extension now correctly point to the configured frontend instance, rather than always to the dev server.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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}/`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants