Description
The ServerSideSDKKeys.js component is a class component using Flux stores (ProjectStore) that causes a crash when ProjectStore.getEnvironment() returns undefined (Sentry issue FLAGSMITH-FRONTEND-4FX). This blocks users from creating server-side keys.
Current state
- Class component (~250 lines)
- Uses
ProjectStore.getEnvironment() for environment name lookup
- Uses imperative
getStore().dispatch() for RTK Query operations
- Contains nested
CreateServerSideKeyModal class component
Objectives
- Migrate to functional components with TypeScript
- Break into smaller, focused components (CreateServerSideKeyModal, ServerSideKeyRow)
- Replace ProjectStore with RTK Query (
useGetEnvironmentsQuery)
- Use RTK Query hooks for server-side key CRUD operations
- Feature flag (
rtk_server_side_sdk_keys) to toggle between old and new
Structure
pages/sdk-keys/
├── SDKKeysPage.tsx
├── index.ts
└── components/
├── ServerSideSDKKeys.tsx
├── CreateServerSideKeyModal.tsx
├── ServerSideKeyRow.tsx
└── index.ts
Related
- Sentry: FLAGSMITH-FRONTEND-4FX —
TypeError: Cannot read properties of undefined (reading 'name') in CreateServerSideKeyModal.render
Description
The
ServerSideSDKKeys.jscomponent is a class component using Flux stores (ProjectStore) that causes a crash whenProjectStore.getEnvironment()returnsundefined(Sentry issue FLAGSMITH-FRONTEND-4FX). This blocks users from creating server-side keys.Current state
ProjectStore.getEnvironment()for environment name lookupgetStore().dispatch()for RTK Query operationsCreateServerSideKeyModalclass componentObjectives
useGetEnvironmentsQuery)rtk_server_side_sdk_keys) to toggle between old and newStructure
Related
TypeError: Cannot read properties of undefined (reading 'name')inCreateServerSideKeyModal.render