Skip to content

refactor(cos): use singular requestFileHandle() instead of requestFileHandles()#1709

Merged
xenova merged 2 commits into
huggingface:mainfrom
tomayac:refactor/cos-singular-requestFileHandle
Jun 16, 2026
Merged

refactor(cos): use singular requestFileHandle() instead of requestFileHandles()#1709
xenova merged 2 commits into
huggingface:mainfrom
tomayac:refactor/cos-singular-requestFileHandle

Conversation

@tomayac

@tomayac tomayac commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Switches from the deprecated plural requestFileHandles([hash]) to the new singular requestFileHandle(hash) API, which returns a FileSystemFileHandle directly rather than a single-element array. Also updates the bundled type definitions to match.

The rename was adopted in the COS spec after a survey of all known real-world implementations found that every call site passed a single-element array and immediately destructured it to one handle — no implementation ever used the plural form as intended.

FYI @nico-martin @xenova — as the author and reviewer of the original COS PR (#1549).

See WICG/cross-origin-storage#61 for details.

@nico-martin

Copy link
Copy Markdown
Collaborator

Thank you very much for the PR. When will the new singular API be available in the browser? And is there a fallback in place for the transition to avoid any syntax errors?

@tomayac

tomayac commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

In the browser we don't know yet, it's already in the extension and it accepts both variants, so no breakage at all.

@nico-martin

Copy link
Copy Markdown
Collaborator

Oh yes, sure. I meant in the extension😄

@nico-martin nico-martin self-assigned this Jun 16, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@tomayac

tomayac commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Oh yes, sure. I meant in the extension😄

I mean, it's a very legitimate question ;-)

The unit test failure seems unrelated:

fatal: unable to access 'https://huggingface.co/hf-internal-testing/tiny-random-T5ForConditionalGeneration/': The requested URL returned error: 429

@nico-martin nico-martin self-requested a review June 16, 2026 16:33
@nico-martin

Copy link
Copy Markdown
Collaborator

The unit test failure seems unrelated:

Yes, we have seen this issue in other places too. We are working on it :)

@xenova xenova left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks!

(ps: fixing the 429 CI issues now 😇 -- will merge after that)

@xenova xenova merged commit 6cc0630 into huggingface:main Jun 16, 2026
1 of 7 checks passed
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.

4 participants