Skip to content

Infinite API request loop when URL points to a non-existent environment #7283

@talissoncosta

Description

@talissoncosta

When the URL contains an environment key that doesn't belong to the current project, the app enters an infinite API request loop against that environment, and the sidebar shows a loading spinner that never resolves.

The "invalid key" case covers any of:

  • An environment that was deleted
  • A typo or manually-edited URL
  • An environment from a different project pasted into this project's URL
  • An environment the user has lost permission to while the tab was open

Steps To Reproduce

  1. Log into app.flagsmith.com
  2. Navigate to any project
  3. Edit the URL so the environment segment is a non-existent key, e.g. /project/<id>/environment/nonexistent/features
  4. Open DevTools → Network tab

Observed:

  • Requests to /api/v1/environments/<invalid-key>/ fire every ~1 second indefinitely
  • Further requests may appear with the literal string undefined as the path segment (e.g. /api/v1/environments/undefined/my-permissions/, /api/v1/environments/undefined/api-keys/)
  • The sidebar shows an infinite loading spinner
  • The main area may render partially or stay stuck on skeletons

Expected behavior

  • The app shows an "Environment not found" state in the main area
  • No further API requests for the invalid environment
  • Sidebar hides or shows a safe empty state (no infinite spinner)
  • Navigating to a valid environment via the top tabs or environment selector recovers the app

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfront-endIssue related to the React Front End Dashboard

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions