-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: use ipld-explorer-components@4.0.0 #119
Conversation
package.json
Outdated
"ipld-git": "^0.2.3", | ||
"ipld-raw": "^2.0.1", | ||
"ipld-zcash": "^0.4.1", | ||
"ipld-explorer-components": "file:../../ipfs/ipld-explorer-components/ipld-explorer-components-3.0.3.tgz", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be updated once ipfs/ipld-explorer-components#360 is merged
@@ -1 +1 @@ | |||
REACT_APP_VERSION=$npm_package_version | |||
VITE_VERSION=$npm_package_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of vite migration
<link rel="manifest" href="/manifest.json"> | ||
<link rel="shortcut icon" href="/favicon.ico"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of vite migration
@@ -36,5 +27,6 @@ | |||
To begin the development, run `npm start` or `yarn start`. | |||
To create a production bundle, use `npm run build` or `yarn build`. | |||
--> | |||
<script type="module" src="/src/index.jsx"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of vite migration
"serve": "vite preview", | ||
"test": "run-s test:unit test:e2e", | ||
"test:unit": "vitest run --environment=node", | ||
"test:unit-playwright": "playwright test -c playwright-ct.config.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not currently used, but available to run unit tests via playwright if we want to normalize on tests.
@@ -11,7 +11,7 @@ export class App extends Component { | |||
doUpdateUrl: PropTypes.func.isRequired, | |||
queryObject: PropTypes.object.isRequired, | |||
registerServiceWorker: PropTypes.func, | |||
route: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired | |||
route: PropTypes.oneOfType([PropTypes.func, PropTypes.element, PropTypes.elementType]).isRequired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes an in-app error regarding prop types mismatch.
// const page = await browser.newPage() | ||
const page = (await browser.pages())[0] | ||
// it('should resolve a dag-pb cid with a path', async () => { | ||
// // Save 3s per run by using the initial page rather than creating a new one! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: need to migrate this test code to playwright.
interesting issue found when doing js-ipfs deprecation: ipfs/js-ipfs#1416 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested latest version from https://bafybeiepdrogejw7eji6qdbq3hpd3ewuuhecyvf4nyofvhntsbyb3w7tqa.on.fleek.co
@SgtPooki looks ok for available content, but trying to fetch something new timeouts bit too early? Lmk if I got things right.
I tried to add a PDF and explore its CID (bafybeibms6xfhs4kx3tun7dg6bjbj5obca7yj43cl5jl3pc2n7muw6ipfm
) and the gateway request for the root block was stuck in "Pending":
and after a while that request got cancelled:
So two problems:
- Why is request for single block in
Pending
? It should fhit gateway asap, before anything else. Are WebTransport requests still suffocating the request queue browser allocates to the page? - Why it cancels (timeouts?) so fast? As long gateway request is in progress or pending, it should not timeout.
Helia should not be making any requests except for to the delegatedClient via kubo-rpc-client: https://github.com/ipfs/ipld-explorer-components/blob/ca19310defb84611f55c46b1efd399217ba4a8c6/src/lib/init-helia.ts#L28-L63
Mostly to keep the site responsive and gateway-friendly. I've currently got the timeout set to 30 seconds. I've heard significant feedback from users that explore.ipld.io would spin and spin and they never knew if their content was going to load. I think a much better approach is to fail early, and have the users refresh/retry if they want. Were you able to fetch your content from http://ipfs.io/ipfs/bafybeibms6xfhs4kx3tun7dg6bjbj5obca7yj43cl5jl3pc2n7muw6ipfm directly? Maybe you removed the content, but I just attempted to access it and it failed after We shouldn't have users guessing whether a request is going to succeed or not. Also, for failed gateway requests, the gateway keeps the connection open for up to 2 minutes, and sends back almost 1K of data: If we cancel requests that are pending for 30 seconds, we can free up the gateway to do other work, and the user can re-request things if they want. If there is a different timeout value you think would be better or a better way to handle this without significant feature work, then please let me know. Drawbacks
Other things to think about
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @SgtPooki, failing fast at 30s mark makes sense as a trade-off,
the problem is bad UX on timeout – user adds data to their local node, then tries to inspect it, timeouts, app looks broken:
One way to fix this without rewriting the entire thing is to inspect error before printing the red box and if it is timeout/promise cancellation, replace it with friendly "Failed to fetch content in 30s, refresh page to retry or try different CID."? It would be good enough to unblock this PR.
Since ipld-explorer-components@4.0.0 is released, would it be ok to merge this as-is, and fill issues for any remaining work ("Drawbacks", "Other things to think about"), and do it in future PRs (if we have time).
Would be shame if this PR got stuck in review forever: It is already better than the old version! :)
I see your approval, but I will work on that error message prior to merging. |
@lidel PR out to address this in ipld-explorer-components: ipfs/ipld-explorer-components#378 |
new preview url, https://bafybeif65hxysjwygngoahx7v6a2ouzsfi4y24u7ovr4vd5ya4jhq7ngjy.on.fleek.co/, updated in description. tested new error message at https://bafybeif65hxysjwygngoahx7v6a2ouzsfi4y24u7ovr4vd5ya4jhq7ngjy.on.fleek.co/#/explore/bafybeibms6xfhs4kx3tun7dg6bjbj5obca7yj43cl5jl3pc2n7muw6ipfm |
Changes deployed on explore.ipld.io. https://explore.ipld.io/#/explore/bafybeibms6xfhs4kx3tun7dg6bjbj5obca7yj43cl5jl3pc2n7muw6ipfm shows the error message appropriately. |
Note that this code is based on changes included in ipfs/ipld-explorer-components#360 and must wait to be merged until we can publish a new ipld-explorer-components lib once that PR is merged.
check out the preview: https://bafybeif65hxysjwygngoahx7v6a2ouzsfi4y24u7ovr4vd5ya4jhq7ngjy.on.fleek.co/
Check out the demo:
explore.ipld.io-2023-05-25-update.mp4
fixes #117
Note that fleek build is failing due to being set to node16,RESOLVEDbut we can't update fleek settings unless 5bb40dd is merged to master.RESOLVED see fix: npm install works with node@18.16.0 #120