Skip to content
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

Fix not found 404 when route to session from speaker view #238

Merged

Conversation

odkhang
Copy link
Collaborator

@odkhang odkhang commented Sep 25, 2024

Summary by Sourcery

Fix the 404 error when routing to a session from the speaker view by updating the session link URL to include the correct base path.

Bug Fixes:

  • Fix the 404 error when navigating to a session from the speaker view by ensuring the correct base URL is used in the session link.

Copy link

sourcery-ai bot commented Sep 25, 2024

Reviewer's Guide by Sourcery

This pull request fixes a 404 "Not Found" error that occurred when routing to a session from the speaker view. The change modifies the URL generation for session links by incorporating the BASE_URL environment variable, ensuring proper routing in different deployment environments.

File-Level Changes

Change Details Files
Modified URL generation for session links
  • Added process.env.BASE_URL to handle different deployment environments
  • Introduced a fallback value of '/video/' if BASE_URL is not set
  • Updated the return statement to use template literals for string interpolation
webapp/src/views/schedule/speakers/item.vue

Sequence Diagram

No sequence diagram generated.


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @odkhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider making the default path ('/video/') configurable or environment-specific to ensure flexibility across different deployment scenarios.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +68 to +69
const publicPath = process.env.BASE_URL || '/video/';
return `${publicPath}schedule/talks/${sessionData.session.id}`;
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Consider potential issues with dynamic base URL in generateSessionLinkUrl

The change introduces a dynamic base URL, which could lead to inconsistent URL generation. Consider the following:

  1. Is process.env.BASE_URL guaranteed to be set in all environments?
  2. The fallback value '/video/' seems arbitrary. Is this intentional?
  3. There's a potential for double slashes in the URL if BASE_URL ends with a slash.

@mariobehling mariobehling merged commit f9c7376 into fossasia:development Sep 26, 2024
2 of 3 checks passed
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.

3 participants