Skip to content

fix(ui): resolve infinite recursion in transaction viewer#15

Merged
oskarszoon merged 1 commit into
bsv-blockchain:mainfrom
oskarszoon:fix/ui-tx-viewer-infinite-recursion
Oct 16, 2025
Merged

fix(ui): resolve infinite recursion in transaction viewer#15
oskarszoon merged 1 commit into
bsv-blockchain:mainfrom
oskarszoon:fix/ui-tx-viewer-infinite-recursion

Conversation

@oskarszoon

Copy link
Copy Markdown
Contributor

Fixes #14

  • Remove reactive alias in tx-details-card causing infinite re-evaluation
  • Refactor async address extraction in tx-io-card to prevent loop
  • Add processedOutputsHash to track processed data and avoid re-processing

Fixes bsv-blockchain#14

- Remove reactive alias in tx-details-card causing infinite re-evaluation
- Refactor async address extraction in tx-io-card to prevent loop
- Add processedOutputsHash to track processed data and avoid re-processing
@oskarszoon oskarszoon requested review from Copilot and removed request for Copilot October 16, 2025 13:23
@oskarszoon oskarszoon marked this pull request as ready for review October 16, 2025 13:23
Copilot AI review requested due to automatic review settings October 16, 2025 13:23

This comment was marked as outdated.

@oskarszoon

Copy link
Copy Markdown
Contributor Author

/claude-review

@claude

claude Bot commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Claude finished @oskarszoon's task —— View job


PR Review: Fix infinite recursion in transaction viewer

Review Summary:

This PR correctly addresses the infinite recursion issues in the transaction viewer. Both fixes are appropriate for Svelte's reactivity model.

Changes Reviewed:

tx-details-card/index.svelte:27

Removed the problematic reactive alias $: d = data that was causing infinite re-evaluation. The fix correctly uses data directly throughout the template, eliminating the unnecessary reactive middleman that triggered loops.

tx-io-card/index.svelte:45-75

Refactored the async address extraction logic to prevent reactive loops:

  • Replaced reactive forEach with explicit extractOutputAddresses() function
  • Added processedOutputsHash to track when outputs have changed
  • Batches address updates into a single assignment to trigger reactivity once

Issues Found:

  1. Type annotation inconsistency (line 60) - See inline comment
  2. Hashing inefficiency (line 50) - See inline comment with suggested optimization

Minor Observations:

  • Both fixes follow proper Svelte reactivity patterns
  • The batched address update approach is good for performance
  • No security concerns identified

Testing Note:
⚠️ Cannot run tests due to fork PR security constraints. Maintainers should verify the UI behaves correctly before merge.

Recommendation: Request changes to address the two optimization opportunities noted in inline comments.


Job Run | Branch: fix/ui-tx-viewer-infinite-recursion

@galt-tr galt-tr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested locally works well for me

@oskarszoon oskarszoon merged commit 69afc1f into bsv-blockchain:main Oct 16, 2025
6 checks passed
@oskarszoon oskarszoon self-assigned this Oct 16, 2025
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.

[BUG] UI transaction view page hang

3 participants