Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set Explore defaults on app load #2268

Merged

Conversation

SgtPooki
Copy link
Member

fix: set Explore defaults on app load

  • sets localStorage settings required by ipld-explorer-components on app load
    • disable remote gateways
    • enable local gateways

@SgtPooki SgtPooki requested a review from a team as a code owner September 23, 2024 20:59
@SgtPooki SgtPooki linked an issue Sep 23, 2024 that may be closed by this pull request
@SgtPooki
Copy link
Member Author

SgtPooki commented Sep 23, 2024

note that we need to update ipld-explorer-components to use @helia/block-brokers@3.0.4 so we do not need to set allowInsecure: true

╰─ ✘ 1 ❯ npm why @helia/block-brokers
@helia/[email protected]
node_modules/@helia/block-brokers
  @helia/block-brokers@"^3.0.3" from @helia/[email protected]
  node_modules/@helia/http
    @helia/http@"^1.0.10" from [email protected]
    node_modules/ipld-explorer-components
      ipld-explorer-components@"^7.0.2" from the root project
  @helia/block-brokers@"^3.0.3" from [email protected]
  node_modules/ipld-explorer-components
    ipld-explorer-components@"^7.0.2" from the root project

src/bundles/ipfs-provider.js Outdated Show resolved Hide resolved
@@ -32,6 +33,11 @@ export class App extends Component {
isOver: PropTypes.bool.isRequired
}

constructor (props) {
super(props)
props.doSetupLocalStorage()
Copy link
Member

Choose a reason for hiding this comment

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

This does not seem to work on initial page load.
If you use empty browser profile and load webui, and then go to ipld explorer and click on wikipedia example you will see spinner forever, and no request:

2024-09-24_00-25_1
2024-09-24_00-25

If you then force-reload the page (F5) the helia will initialize with local gateway and work fine:

2024-09-24_00-29

Copy link
Member Author

Choose a reason for hiding this comment

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

I think landing directly on explore page might cause the issue?

Issue doesn't happen if you land on status page first

Copy link
Member Author

Choose a reason for hiding this comment

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

Might need to call the localStorage fn in router / component loader

Copy link
Member Author

Choose a reason for hiding this comment

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

landing directly on explore page works for me with the latest.

2024-09-24.at.9.53.41.-.Blue.Bobolink.mp4

Copy link
Member

Choose a reason for hiding this comment

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

Yep, that was it. New version works fine.

ps. TIL Firefox does not support HEVC while it is encumbered by patents, so inline player does not work (but i played fine with external player):

image

@SgtPooki
Copy link
Member Author

SgtPooki commented Sep 24, 2024

@lidel try now, it should work now that we're explicitly using [email protected]

I believe you tested this after I committed ebefbea (#2268). allowLocal wasn't enough to allow querying the local Kubo node. That was fixed by ipfs/helia#579

Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

@@ -32,6 +33,11 @@ export class App extends Component {
isOver: PropTypes.bool.isRequired
}

constructor (props) {
super(props)
props.doSetupLocalStorage()
Copy link
Member Author

Choose a reason for hiding this comment

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

landing directly on explore page works for me with the latest.

2024-09-24.at.9.53.41.-.Blue.Bobolink.mp4

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thanks, it now works 🥳 feel free to ship a patch release.

(I also confirmed running on a custom RPC port also works)

@SgtPooki SgtPooki merged commit fd8819e into main Sep 24, 2024
22 checks passed
@SgtPooki SgtPooki deleted the 2266-explore-page-stop-sending-requests-to-remote-http-servers branch September 24, 2024 16:13
ipfs-gui-bot pushed a commit that referenced this pull request Sep 24, 2024
## [4.3.2](v4.3.1...v4.3.2) (2024-09-24)

 CID `bafybeif6abowqcavbkz243biyh7pde7ick5kkwwytrh7pd2hkbtuqysjxy`

 ---

### Bug Fixes

* set Explore defaults on app load ([#2268](#2268)) ([fd8819e](fd8819e))
* **ui:** replace IPFS API with Kubo RPC ([#2267](#2267)) ([f8ac305](f8ac305))

### Trivial Changes

* pull new translations ([#2264](#2264)) ([cfaf534](cfaf534))
@ipfs-gui-bot
Copy link
Collaborator

🎉 This PR is included in version 4.3.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore page: stop sending requests to remote HTTP servers
3 participants