Skip to content

feat(core): network fallback precedence, locale-safe formatting, lazy-import failures, clipboard recovery (#136–#139) - #172

Merged
BigDella merged 1 commit into
Parcel-Protocol:mainfrom
Gbemi-programmer:feature/core-hardening-136-139
Sep 27, 2026
Merged

BigDella merged 1 commit into
Parcel-Protocol:mainfrom
Gbemi-programmer:feature/core-hardening-136-139

Conversation

@Gbemi-programmer

Copy link
Copy Markdown
Contributor

Closes #136
Closes #137
Closes #138
Closes #139

Note: the issues target dev, but the repo has no dev branch right now, so this is based on main.

#139 Network-configuration fallback precedence

  • resolveNetwork(stored, env): persisted selection > NEXT_PUBLIC_STELLAR_NETWORK > testnet. Unknown values are ignored at every level. NetworkProvider uses it.
  • resolveEndpoint(override, fallback): endpoint env overrides are used only when they are valid http(s) URLs with no embedded credentials. Otherwise the default is used.
  • redactEndpoint(): shows only origin and path in diagnostics, so no query/fragment/userinfo secrets appear.
  • Tests: precedence matrix, malformed URLs, credential-bearing URLs, redaction.

#138 Locale-safe date and amount formatting

  • Documented fallback policy: a malformed locale tag falls back to the runtime default instead of throwing (safeLocales, used by both amount and date formatters).
  • Tests: zero, negatives, 1-stroop precision, int64 bounds, Arabic/Devanagari digits, RTL (he-IL) negatives, invalid timestamps, UTC for any locale. No floating-point math on amounts.

#137 Registry lazy-import failure states

  • loadFeaturePanel() returns a typed Result. A rejected import becomes load_failed with { slug, errorName } only (no message or stack, so no URLs or tokens leak into telemetry).
  • /tools/[slug] still 404s for unknown slugs. An installed slice that fails to load now shows a recovery screen instead of a blank page or a 500. generateStaticParams is unchanged.
  • Tests: resolved import, rejected chunk load, non-Error rejection, unknown slug. No network calls.

#136 Clipboard permission-denied recovery

  • copyText throws a typed ClipboardError (unavailable | denied).
  • tryCopyText never throws. It falls back to execCommand("copy") and returns "copied" only when a copy actually happened.
  • CopyableValue shows an accessible role="alert" hint with the full value, selectable, when copying fails. It never claims success.
  • Browser-mock tests: success, API unavailable, permission denied, fallback selection, and the component's success and failure UI.

Checks

  • New and affected suites pass; lint is clean on the changed files; tsc shows no new errors.
  • main already fails tsc and 21 vitest tests in 11 files. This branch has the identical set of failures and adds no new ones.
  • registry.ts on main referenced generatedFeatures without importing it; the import is added here because [Core] Define registry lazy-import failure states #137 changes this file.

@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@Gbemi-programmer 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! 🚀

Learn more about application limits

@BigDella
BigDella merged commit 9d5ff9c into Parcel-Protocol:main Sep 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants