Skip to content

refactor: check if boxo/files.File is io.Seeker - #11254

Merged
lidel merged 1 commit into
masterfrom
fix/boxo-files-remove-seeker-from-file-interface
May 15, 2026
Merged

lidel merged 1 commit into
masterfrom
fix/boxo-files-remove-seeker-from-file-interface

Conversation

@lidel

@lidel lidel commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR updates boxo to ipfs/boxo#1128 which removes io.Seeker from the files.File interface.
The goal is to see what happens. Callers that need seeking now type-assert to io.Seeker.

Turns our we dont have that many?

  • core/commands/cat: type-assert before seeking
  • core/coreiface/tests: type-assert before seeking

TODO

@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Mar 26, 2026
@gammazero gammazero added the status/blocked Unable to be worked further until needs are met label Apr 14, 2026
lidel added a commit to ipfs/boxo that referenced this pull request May 14, 2026
show the before/after migration pattern for callers and link to
ipfs/kubo#11254 as a worked example of updating consumers.
@lidel
lidel force-pushed the fix/boxo-files-remove-seeker-from-file-interface branch from b26b82c to 3bb4ede Compare May 14, 2026 23:30
lidel added a commit to ipfs/boxo that referenced this pull request May 15, 2026
* fix(files): remove io.Seeker from File interface

Not all File implementations can seek. ReaderFile wrapping an HTTP
multipart stream and WebFile both returned ErrNotSupported at runtime,
which caused interface-sniffing bugs in downstream consumers like
go-car (ipfs/kubo#9361).

Seeking is now opt-in: implementations that support it (ReaderFile
with a seekable reader, Symlink, ufsFile) still have a Seek method
and callers type-assert to io.Seeker when needed.

- files: remove io.Seeker from File interface
- files: remove dummy WebFile.Seek that always returned ErrNotSupported
- gateway: type-assert to io.Seeker before seeking in all handlers

* docs: add breaking change to changelog
* docs: clarify io.Seeker breaking change in changelog

show the before/after migration pattern for callers and link to
ipfs/kubo#11254 as a worked example of updating consumers.

* docs: expand io.Seeker rationale with go-car workaround example
* docs: break Action required onto new line
Update boxo to ipfs/boxo#1128 which removes io.Seeker from the
files.File interface. Callers that need seeking now type-assert
to io.Seeker.

- core/commands/cat: type-assert before seeking
- core/coreiface/tests: type-assert before seeking
@lidel
lidel force-pushed the fix/boxo-files-remove-seeker-from-file-interface branch from 3bb4ede to 1e50692 Compare May 15, 2026 00:05
@lidel
lidel marked this pull request as ready for review May 15, 2026 00:05
@lidel
lidel requested a review from a team as a code owner May 15, 2026 00:05
@lidel lidel removed the status/blocked Unable to be worked further until needs are met label May 15, 2026
@lidel lidel changed the title chore: update boxo to remove io.Seeker from files.File refactor: check if files.File is io.Seeker May 15, 2026
@lidel lidel changed the title refactor: check if files.File is io.Seeker refactor: check if boxo/files.File is io.Seeker May 15, 2026
@lidel
lidel merged commit f485a7e into master May 15, 2026
28 of 29 checks passed
@lidel
lidel deleted the fix/boxo-files-remove-seeker-from-file-interface branch May 15, 2026 00:21
@lidel lidel mentioned this pull request May 19, 2026
31 of 40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does NOT require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants