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
- Log into app.flagsmith.com
- Navigate to any project
- Edit the URL so the environment segment is a non-existent key, e.g.
/project/<id>/environment/nonexistent/features
- 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
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:
Steps To Reproduce
/project/<id>/environment/nonexistent/featuresObserved:
/api/v1/environments/<invalid-key>/fire every ~1 second indefinitelyundefinedas the path segment (e.g./api/v1/environments/undefined/my-permissions/,/api/v1/environments/undefined/api-keys/)Expected behavior