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

Unable to traverse inside of a chunked file #461

Closed
lidel opened this issue Nov 9, 2024 · 1 comment · Fixed by #462
Closed

Unable to traverse inside of a chunked file #461

lidel opened this issue Nov 9, 2024 · 1 comment · Fixed by #462
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@lidel
Copy link
Member

lidel commented Nov 9, 2024

Describe the bug

Walking into a file makes it impossible to navigate further due to no path label to click.

To Reproduce

  1. Go to https://explore.ipld.io/#/explore/QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D/albums/QXBvbGxvIDE0IE1hZ2F6aW5lIDY0L0xM/21076550124_dfaa21d664_o.jpg (Apollo Archives Example)
  2. Click on any chunk, eg. 0 or 1
  3. See that nothing happens, only a breadcrumb is added, but navigation does not happen

Expected behavior

Clicking on a node without Path should still work, and navigate to respective child chunk.

Screenshots

2024-11-09_02-07

Additional context

@lidel lidel added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Nov 9, 2024
@SgtPooki
Copy link
Member

The actual bug is here:

path: link.Name ?? `Links/${index}`,

This was another part of updating to the latest aegir.. basically we were previously doing foo || other thing that was triggering if the first var was an empty string, but we're now doing the more idiomatic foo ?? other thing.

image

The helper function to use in this case is

/**
* When migrating to typescript and removing redux-bundler, a lot of old code
* had checks like `path ? path : null` which would fire as "false" when the
* path was an empty string. This function helps the migration path but should
* be removed once all the old code is updated.
*/
export function isFalsy <T> (str: T | null | string | undefined): str is null {
if (str == null || str === '') return true
return false
}
export function isTruthy <T> (str: T | null | string | undefined): boolean {
return !isFalsy(str)
}

SgtPooki added a commit that referenced this issue Nov 21, 2024
@SgtPooki SgtPooki linked a pull request Nov 21, 2024 that will close this issue
github-actions bot pushed a commit that referenced this issue Nov 21, 2024
## [8.1.1](v8.1.0...v8.1.1) (2024-11-21)

### Bug Fixes

* links without paths can be navigated ([#462](#462)) ([1effbe7](1effbe7)), closes [#461](#461)
SgtPooki added a commit that referenced this issue Nov 21, 2024
SgtPooki added a commit that referenced this issue Nov 22, 2024
* test: add e2e tests

* chore: generate fixtures script can start/stop kubo daemon for you

* chore: generate-fixtures-script allows paths

* chore: rename generate fixtures script

* test: migrate test fixture/helper

* test: add test for bug #461

* chore: fix dep-check

* chore: apply suggestions from code review

* chore: fix lint
github-actions bot pushed a commit that referenced this issue Nov 22, 2024
## [8.1.2](v8.1.1...v8.1.2) (2024-11-22)

### Tests

* add e2e tests ([#463](#463)) ([c865b5f](c865b5f)), closes [#461](#461)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants