Skip to content

verify-env-validation.mjs never builds with NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC or a rejected URL scheme, only TESTNET and a malformed URL #417

Closed

Description

@abayomicornelius

Problem

scripts/verify-env-validation.mjs (closing #205's gap of never testing a real custom-URL build) still has two of its own analogous gaps:

  1. NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC is never exercised. Every CASES entry that expects a successful build only ever sets NEXT_PUBLIC_STELLAR_NETWORK: "TESTNET":

    { name: "valid NEXT_PUBLIC_STELLAR_NETWORK=TESTNET builds successfully", env: { NEXT_PUBLIC_STELLAR_NETWORK: "TESTNET" }, expectSuccess: true },
    { name: "valid custom NEXT_PUBLIC_API_URL builds successfully", env: { NEXT_PUBLIC_STELLAR_NETWORK: "TESTNET", NEXT_PUBLIC_API_URL: "https://api.example.com" }, expectSuccess: true },

    "PUBLIC" is one of exactly two valid values (VALID_STELLAR_NETWORKS in src/lib/env.ts) and is the one that matters most — it's what a real production deploy would set — yet a regression that broke the build specifically for "PUBLIC" while leaving "TESTNET" working would pass this script undetected.

  2. The rejected-URL-scheme case (validateApiUrl accepts any URL scheme, including javascript: and file:, as a valid NEXT_PUBLIC_API_URL #204) is never exercised at the build level. validateApiUrl explicitly rejects javascript:/file:/non-http(s) schemes (added for validateApiUrl accepts any URL scheme, including javascript: and file:, as a valid NEXT_PUBLIC_API_URL #204), but no CASES entry sets NEXT_PUBLIC_API_URL to a disallowed scheme — only a malformed, unparseable URL ("not-a-url") is tested. #204's fix has real build-level coverage for the "not a URL at all" branch but not the "is a URL, wrong scheme" branch this script's own sibling issue (validateApiUrl accepts any URL scheme, including javascript: and file:, as a valid NEXT_PUBLIC_API_URL #204) exists to guard.

Impact

This script's entire purpose (per its own top comment) is proving env validation works "through a real next build, not just in isolation" — but two of the exact branches past issues (#204, and PUBLIC being the production-critical network value) were about aren't covered by that real-build guarantee, only by whatever unit-level coverage env.test.ts separately provides.

Suggested fix

Add two more CASES entries: { name: "valid NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC builds successfully", env: { NEXT_PUBLIC_STELLAR_NETWORK: "PUBLIC" }, expectSuccess: true } and a rejected-scheme case (NEXT_PUBLIC_API_URL: "javascript:alert(1)", expectSuccess: false, expectedMessageFragment: 'uses the "javascript:" scheme').

Activity

  1. added
    testing
    on Sep 17, 2026
  2. ranjeet150 commented on Sep 17, 2026

    @ranjeet150

    Hello team,

    I can tackle verify-env-validation.mjs never builds with NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC or a rejected URL scheme, only TESTNET and a malformed URL. Proposed implementation roadmap:

    • Analysis: Inspect current behavior and edge cases in MergeFi/frontend
    • Core Implementation: Add comprehensive test coverage for verify-env-validation.mjs never builds with NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC or a rejected URL scheme, only TESTNET and a malformed URL verifying edge cases and failure scenarios.
    • Quality Assurance: Validate both positive flows and negative/revert branches.

    Ready to deliver a clean, tested PR within 12–24 hours. Please assign!

  3. added
    Stellar Wave
    on Sep 23, 2026
  4. ARAPHI20 commented on Sep 23, 2026

    @ARAPHI20

    @ARAPHI20 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi! I’m a full-stack developer with a strong blockchain background. I’d love to handle this issue and can deliver a clean, reliable solution. Kindly assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ARAPHI20 to this issue.

  5. shekwolonathanielbala-cyber commented on Sep 23, 2026

    @shekwolonathanielbala-cyber

    @shekwolonathanielbala-cyber has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello I would like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @shekwolonathanielbala-cyber to this issue.

  6. officialtemzs commented on Sep 23, 2026

    @officialtemzs

    @officialtemzs has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    i would love to work on this issues

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @officialtemzs to this issue.

  7. Morrison26-gif commented on Sep 23, 2026

    @Morrison26-gif

    @Morrison26-gif has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi Maintainer, I’ve looked over the requirements and acceptance criteria and believe I can implement a solution that aligns with what’s expected. Kindly consider assigning it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Morrison26-gif to this issue.

  8. davidjhonsonmate commented on Sep 23, 2026

    @davidjhonsonmate
    Contributor

    @davidjhonsonmate has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    please assign this issue to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @davidjhonsonmate to this issue.

  9. drips-wave commented on Sep 23, 2026

    @drips-wave

    Congratulations, @davidjhonsonmate! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @davidjhonsonmate: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  10. added a commit that references this issue on Sep 25, 2026
  11. drips-wave commented on Sep 25, 2026

    @drips-wave

    This issue has been completed by @davidjhonsonmate as part of the Stellar Wave Program's 9th Wave 🥳

    😎 @davidjhonsonmate: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  12. removed
    Stellar Wave
    on Oct 15, 2026
  13. added
    Stellar Wave
    on Oct 15, 2026
  14. removed
    Stellar Wave
    on Oct 15, 2026
  15. added
    Stellar Wave
    on Oct 15, 2026
  16. removed
    Stellar Wave
    on Oct 15, 2026
  17. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar Wavetesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions