Skip to content

Improve and test startup config validation error messages #240

Description

@Lakes41

Difficulty: Intermediate
Type: bug

Background
The README states the app uses a typed configuration layer validating EXPO_PUBLIC_API_URL and EXPO_PUBLIC_CHAIN_ID at startup, throwing a "clear developer-facing error in development" if they're missing or invalid, to prevent silent fallback to production defaults.

Problem
It's not verified that these error messages are actually specific and actionable (naming the exact variable and what's wrong with it) rather than a generic "invalid config" message, and there's no indication this validation logic is covered by unit tests.

Expected outcome
Each config validation failure (missing EXPO_PUBLIC_API_URL, malformed URL, missing EXPO_PUBLIC_CHAIN_ID, non-numeric/invalid chain ID) throws a distinct, specific error identifying the variable and the problem, and this logic has unit test coverage for every case.

Suggested implementation

  • Locate the config validation module (likely src/ or a root config.ts) and review current error messages for specificity.
  • Rewrite generic error messages to name the exact variable and expected format/value.
  • Add a test file covering: missing EXPO_PUBLIC_API_URL, malformed URL, missing EXPO_PUBLIC_CHAIN_ID, non-numeric chain ID, and the valid/passing case.
  • Verify the error is dev-only (not shown/thrown in a way that would crash a production build if config were somehow correct at build time but the check redundantly ran).

Acceptance criteria

  • Each invalid config case produces a distinct, specific error message
  • Unit tests cover the full validation matrix
  • Valid configuration passes without any warnings

Likely affected files/directories

  • src/ (config validation module)
  • tests/

Activity

  1. added
    bugConfirmed defect or incorrect behavior that needs to be fixed
    Maybe RewardedIssue may qualify for a reward upon successful completion per campaign rules
    GrantFox OSSGrantFox Open Source Sponsorship program tag
    Official Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewards
    intermediateIntermediate difficulty tasks requiring solid experience and some context
    on Jul 25, 2026
  2. Afolabi08 commented on Jul 25, 2026

    @Afolabi08

    I'd like to take this on. I've worked on config validation and error handling before, including writing targeted unit tests for edge cases. I can rewrite the validation errors to name the exact variable and issue for each case, add test coverage for the missing/malformed URL and chain ID cases plus the valid pass-through, and confirm the checks stay dev-only.

  3. grantfox-oss commented on Jul 26, 2026

    @grantfox-oss

    🦊 GrantFox — @Afolabi08 has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #240)
    2. Your PR will be reviewed by the Adamantine-guild maintainers

    Good luck! Track your progress on GrantFox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsbugConfirmed defect or incorrect behavior that needs to be fixedintermediateIntermediate difficulty tasks requiring solid experience and some context

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions