Skip to content

Batch fix: wallet error boundary, resize debounce, dead error variant, mocked test auth - #371

Merged
ALLEN-AYODEJI merged 2 commits into
Trellis-Ecosystem:masterfrom
Lost-Z:ix/four-issues-batch-301-302-303-300
Aug 30, 2026
Merged

Batch fix: wallet error boundary, resize debounce, dead error variant, mocked test auth#371
ALLEN-AYODEJI merged 2 commits into
Trellis-Ecosystem:masterfrom
Lost-Z:ix/four-issues-batch-301-302-303-300

Conversation

@Lost-Z

@Lost-Z Lost-Z commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ Warning

This PR was implemented but not tested or compiled/run — per explicit request, no cargo test, npm test, or manual verification was performed. Please build/test before merging, especially the Rust contract test changes in test.rs (event-topic decoding via Symbol::try_from_val), which use a soroban-sdk testutils pattern that has not been compiled in this session.

Summary

Bundles four independent fixes into one PR:

  • Add Error Boundary Wrapper Around WalletConnect for Freighter Extension Failures #301 — Add WalletErrorBoundary and wrap WalletConnect in the navbar with it, so a Freighter extension throw during detection/connection shows an inline fallback with a retry button instead of crashing the whole app. Errors are logged via console.error in componentDidCatch.
  • Fix NetworkBackground Resize Handler Causing Layout Thrashing on Window Resize #300NetworkBackground's resize handler now debounces to 200ms (was a 100ms throttle) and skips the resize/recalibration work entirely when the physical canvas size hasn't actually changed. Particle positions continue to be preserved (scaled) across resizes via the existing recalibrateParticles.
  • Eliminate Dead-Code NoFundsToRefund Error Variant From ABI Surface #302 — Removed the dead-code NoFundsToRefund error variant from TrellisError (discriminant 6, never returned by any codepath). Discriminant 6 is left vacant with a comment explaining why, per the enum's append-only stability rule. No CLI or frontend code referenced this variant.
  • Fix No-Op Event Assertion in Integration Tests -- Mocked Auth Silently Skips Verification #303 — Replaced all env.mock_all_auths() calls in contracts/trellis_core/src/test.rs with targeted auth_as(&env, &payer) calls (verified init only requires the payer's auth), and removed two mock-auth calls guarding extend_agreement_ttl, which has no require_auth() gate at all. Replaced the always-true all_events.is_empty() || all_events.len() >= 4 assertion in test_happy_path with a real check that the escrow contract's own events fire in order (created → locked → submitted → released), decoding each event's topic-0 symbol.

Test plan

  • cargo test -p trellis_core (contract changes are unverified — see warning above)
  • npm run build / npm test in frontend/
  • Manually simulate a Freighter throw and confirm the wallet fallback + retry works
  • Rapidly resize the window and confirm no layout thrashing, particles preserved

Closes #301
Closes #300
Closes #302
Closes #303

…riant, mocked test auth

- frontend(Trellis-Ecosystem#301): wrap WalletConnect in a dedicated WalletErrorBoundary so a
  Freighter extension failure shows an inline retry instead of crashing the app
- perf(Trellis-Ecosystem#300): debounce NetworkBackground's resize handler to 200ms and skip
  recalculation when the physical canvas size hasn't changed
- refactor(contract, Trellis-Ecosystem#302): remove the dead-code NoFundsToRefund error variant,
  leaving discriminant 6 vacant with a comment explaining why
- fix(contract test, Trellis-Ecosystem#303): replace env.mock_all_auths() with targeted
  auth_as() calls in test.rs, and replace the always-true event assertion in
  test_happy_path with a real check of event names/order

Closes Trellis-Ecosystem#301, Closes Trellis-Ecosystem#300, Closes Trellis-Ecosystem#302, Closes Trellis-Ecosystem#303
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Lost-Z 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

@ALLEN-AYODEJI
ALLEN-AYODEJI merged commit 4e52639 into Trellis-Ecosystem:master Aug 30, 2026
2 of 7 checks 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

2 participants