Skip to content

fix: restore a working CI baseline on main - #376

Merged
godamongstmen897 merged 4 commits into
mainfrom
fix/frontend-baseline
Aug 31, 2026
Merged

fix: restore a working CI baseline on main#376
godamongstmen897 merged 4 commits into
mainfrom
fix/frontend-baseline

Conversation

@godamongstmen897

Copy link
Copy Markdown
Contributor

CI has been failing at the Install step, so no run has reached lint, typecheck, tests or build in some time. Four separate problems were hiding behind that one failure.

1. npm ci could not run at all

package.json and package-lock.json were out of sync (missing typescript@4.9.5, @noble/hashes@2.4.0). Every job died before installing.

The lockfile is regenerated so npm ci --ignore-scripts resolves. No dependency versions changed — I checked @stellar/freighter-api specifically, which stays on 6.0.0 before and after.

2. WalletBadge.tsx did not parse

A bad merge left two complete implementations concatenated in one file — two export defaults and an unclosed brace.

Both prop shapes are genuinely in use, so neither could simply be deleted:

Caller Props
Navbar (production) isConnecting, providerName, networkMismatch
wallet_badge.test.tsx isConnected, isConnecting
wallet-badge.test.tsx, wallet-badge-stories.test.tsx status, errorMessage

The merged component takes the union of both and dispatches on whether status was supplied. Every impl-B test that asserts on text passes status; no impl-A test does — so the two renderings stay cleanly separated. All three test files (46 assertions) pass against the single component.

3. Two lost identifiers

useToast had lost its import in FreighterConnector, and a short() address helper had vanished from Navbar — replaced with the existing formatAddress export rather than reintroducing a duplicate.

4. Test environment and fixtures

  • @stellar/freighter-api is CommonJS and reaches the app through @creit.tech/stellar-wallets-kit, so every suite rendering a context-dependent component died on Named export 'getAddress' not found. Both are now inlined for the dep optimizer.
  • The multi-sig hook tests fed base64("aaaa…") to a real Stellar parser while the test name claimed to parse "a well-formed envelope". They now build and sign a real envelope — the assertion matches its own description.
  • One loader test asserted before React had flushed a subscription update; wrapped in act().

Result

step status
Lint 1 known error (below)
Type check clean
Test 1352 passing, 88/88 files
Build passes

The remaining lint error is react-hooks/set-state-in-effect in SignatureTimeoutAlert. I deliberately left it: open PR #353 already fixes it properly with useMemo, and that contributor should keep the credit. Merging #353 next clears it.

🤖 Generated with Claude Code

otsimaofficial and others added 2 commits August 29, 2026 01:02
…ad of setState-in-effect

CI's lint step has been red since #283/#284/#287: ESLint's
react-hooks/set-state-in-effect rule flags the effect that called
setParseMessage synchronously right after checking activeTransactionXdr.
The value is purely derived from activeTransactionXdr, so compute it
with useMemo during render instead of scheduling a second render via
an effect.
CI has been failing at the Install step, so no run has reached lint,
typecheck, tests or build in some time. Four separate problems were
hiding behind that.

1. npm ci could not run at all: package.json and package-lock.json were
   out of sync (missing typescript@4.9.5 and @noble/hashes@2.4.0). The
   lockfile is regenerated so `npm ci --ignore-scripts` resolves. No
   dependency versions changed - @stellar/freighter-api stays on 6.0.0.

2. WalletBadge.tsx held two complete implementations concatenated by a
   bad merge, with two `export default`s and an unclosed brace, so the
   file did not parse. Both prop shapes are genuinely live: Navbar drives
   the badge with isConnecting/providerName/networkMismatch, while the
   design-token call sites drive it with an explicit status. The merged
   component takes the union and dispatches on `status`, so all three
   test files (46 assertions) pass against one component.

3. Two identifiers had been lost from their modules - useToast in
   FreighterConnector and a `short()` address helper in Navbar. The
   latter is replaced by the existing formatAddress export.

4. Tests: @stellar/freighter-api is CommonJS and reaches the app through
   @creit.tech/stellar-wallets-kit, so every suite rendering a
   context-dependent component died on a named-export error. Both are
   now inlined for the dep optimizer. The multi-sig hook tests fed
   base64 of "aaaa..." to a real Stellar parser while claiming to parse
   "a well-formed envelope"; they now build and sign a real envelope.
   One loader test asserted before React had flushed a subscription
   update, and is wrapped in act().

Lint, typecheck, 1352 tests across 88 files, and build all pass. One
lint error remains in SignatureTimeoutAlert (setState in effect); it is
left alone because open PR #353 fixes it properly with useMemo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 31, 2026 10:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

# Conflicts:
#	app/components/SignatureTimeoutAlert.tsx
Every test passed but vitest still exited 1: three promises rejected
while nothing was listening, because the .catch() was attached after
vi.advanceTimersByTimeAsync/runAllTimersAsync had already fired the
rejection. Vitest counts those as unhandled errors and fails the run.

Attaching the handler before advancing keeps the assertions identical
and takes the suite to exit code 0.
@godamongstmen897
godamongstmen897 merged commit cd1848a into main Aug 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants