Skip to content

refactor(env): replace inline process.env reads with BACKEND_URL in lib/#1415

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
VarunShukla07:fix/env-config-lib-files
May 20, 2026
Merged

refactor(env): replace inline process.env reads with BACKEND_URL in lib/#1415
MODSetter merged 1 commit into
MODSetter:devfrom
VarunShukla07:fix/env-config-lib-files

Conversation

@VarunShukla07
Copy link
Copy Markdown
Contributor

@VarunShukla07 VarunShukla07 commented May 19, 2026

Description

Replaced inline process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL reads in lib/ files with BACKEND_URL imported from @/lib/env-config

Motivation and Context

FIX #1374

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Refactoring

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR refactors the lib/ directory to eliminate inline process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL reads by replacing them with a centralized BACKEND_URL constant imported from @/lib/env-config. The changes affect three files: the base API service initialization, authentication utilities (logout and token refresh functions), and thread persistence URL generation. This improves code maintainability by centralizing environment variable access and removes hardcoded fallback URLs.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/lib/apis/base-api.service.ts
2 surfsense_web/lib/auth-utils.ts
3 surfsense_web/lib/chat/thread-persistence.ts

Need help? Join our Discord

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@VarunShukla07 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 142aaa09-b735-4fce-be4b-4a8245baaca0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MODSetter MODSetter merged commit 8823574 into MODSetter:dev May 20, 2026
7 of 12 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.

2 participants