Repository navigation
Frontend (consume at startup with a typed schema) - #1775
Merged
Merged
Conversation
|
@victorEdeh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1723
closes #1724
closes #1725
closes #1722
Summary of what's in place:
Backend (public, non-secret discovery endpoint)
PublicConfigSchema(strict) +PUBLIC_FEATURE_FLAG_KEYSallow-list (deposit-v2,strategy-selection,analytics-page), exported from index.ts .getPublicFlags()returns only allow-listed keys, only booleans, and never the per-walletallowlist. A sharedevaluate()keeps the anonymous view from diverging fromisEnabled().buildPublicConfig()reads live state (env.NODE_ENV, live flags,getMaintenanceModeState().enabled) and validates against the shared schema, so it can't drift.GET /config.mergeDiscoveredRoutesappend-order);CRITICAL_ENDPOINTS/snapshots intentionally untouched sosnapshots:checkstays green.Frontend (consume at startup with a typed schema)
fetchPublicConfig()doesapiClient.get("/config")thenvalidate(PublicConfigSchema, …)(re-exported through schemas.ts / index.ts )./config, mapsANALYTICS_PAGE → analytics-page, and overrides flags; the build-timeVITE_FF_*value is now a fail-closed fallback used only before the response or if the request fails.useFeatureFlag's API is unchanged.Verification note
backend/node_modulesandfrontend/node_modulesare absent (only the root pnpm store is partially installed;zod,react, etc. are not resolvable), so Jest/Vitest could not be executed here. Verification was static: I confirmedgetMaintenanceModeState().enabledmatches the real export/interface in maintenanceMode.ts , that@yieldvault/api-schemasis already a load-bearing runtime import ( validate.ts ), and that/config's OpenAPI block matches the generator's per-operation serialization byte-for-byte. Runpnpm install,pnpm build:schemas, thenpnpm testto confirm.One optional follow-up (not required by the issue): FEATURE_FLAGS.md still describes
VITE_FF_*as the sole mechanism; it now acts as a fallback.