GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Inconsistency between spec and tests for detached arraybuffers; spec for keys says don't throw, test for keys says throw, spec for values says throw · Issue #417 · w3c/IndexedDB

Inconsistency between spec and tests for detached arraybuffers; spec for keys says don't throw, test for keys says throw, spec for values says throw #417

New issue
Copy link
New issue
Copy link
Closed
#440
Closed
Inconsistency between spec and tests for detached arraybuffers; spec for keys says don't throw, test for keys says throw, spec for values says throw#417
#440
Copy link
Assignees
SteveBeckerMSFT
Labels
needs-pr

Description

@asutherland
asutherland
opened on Mar 26, 2024
Issue body actions

While addressing a Firefox test failure in idb-binary-key-detached.htm in https://phabricator.services.mozilla.com/D202947 we became aware of a chromium issue https://issues.chromium.org/issues/40282817 which correctly points out that the IDB invocation of getting a copy of the bytes held by the buffer source in convert a value to a key means we shouldn't throw because webidl says to "return the empty byte sequence".

However, StructuredSerializeInternal step 13.2.1 says:

If IsDetachedBuffer(value) is true, then throw a "DataCloneError" DOMException.

Arguably the current test behavior (which Blink implements) is the most consistent and developer-friendly behavior. It would be weird for a detached arraybuffer to fail as a value but succeed with a potentially incorrect result as a key.

I would propose we:

  • Modify the IDB spec to explicitly return invalid if "IsDetachedBuffer".
    • Note this will throw a DataError rather than the TypeError expected by the test. I'm not opposed to retaining TypeError, but it would be good to have some rationale for choosing that given that we otherwise just seem to return DataError and structured serialization returns DataCloneError.
  • Update the existing test to expect DataError
  • Add a case for a key that is a JS array that contains a detached arraybuffer.
Reacted by Evan Stade

Activity

  1. inexorabletash commented on Mar 26, 2024

    @inexorabletash
    inexorabletash
    on Mar 26, 2024
    Member
    More actions

    SGTM. @evanstade - any opinions?

    Anyone up for a PR for the spec?

  2. evanstade commented on Mar 26, 2024

    @evanstade
    evanstade
    on Mar 26, 2024
    Contributor
    More actions

    sgtm

  3. inexorabletash commented on Mar 26, 2024

    @inexorabletash
    inexorabletash
    on Mar 26, 2024
    Member
    More actions

    cc: @SteveBeckerMSFT

  4. inexorabletash
    added
    needs-pr
    on Mar 26, 2024
  5. SteveBeckerMSFT commented on Apr 17, 2024

    @SteveBeckerMSFT
    SteveBeckerMSFT
    on Apr 17, 2024
    Collaborator
    More actions

    cc: @SteveBeckerMSFT

    @inexorabletash , sorry, missed this until now. Yes, we can work on a spec PR for this inconsistency.

    Reacted by Joshua Bell and sideshowbarker
  6. aarongable
    added a commit that references this issue on Aug 7, 2024

    IDB Interop: Throw DataError when detached ArrayBuffer is used as a key

    faa7b4a
  7. SteveBeckerMSFT
    self-assigned this
    on Sep 9, 2024
  8. chromium-wpt-export-bot
    added a commit that references this issue on Feb 26, 2025

    [IndexedDB] Add more detached array buffer WPT coverage for keys

    7f08fdd
  9. inexorabletash
    closed this as completedin #440on Feb 26, 2025
  10. inexorabletash
    closed this as completedin c659eb3on Feb 26, 2025
  11. chromium-wpt-export-bot
    added a commit that references this issue on Feb 26, 2025

    [IndexedDB] Add more detached array buffer WPT coverage for keys

    69f7099
  12. aarongable
    added a commit that references this issue on Feb 27, 2025

    [IndexedDB] Add more detached array buffer WPT coverage for keys

    8473f77
  13. chromium-wpt-export-bot
    added 2 commits that reference this issue on Feb 27, 2025

    [IndexedDB] Add more detached array buffer WPT coverage for keys

    c864215

    [IndexedDB] Add more detached array buffer WPT coverage for keys

    63eb06e
  14. moz-v2v-gh
    added a commit that references this issue on Feb 28, 2025

    Bug 1950533 [wpt PR 50955] - [IndexedDB] Add more detached array buff…

    1c60967
  15. gecko-dev-updater
    added 3 commits that reference this issue on Mar 1, 2025

    Bug 1950533 [wpt PR 50955] - [IndexedDB] Add more detached array buff…

    c141bd0

    Bug 1950533 [wpt PR 50955] - [IndexedDB] Add more detached array buff…

    638a26a

    Bug 1950533 [wpt PR 50955] - [IndexedDB] Add more detached array buff…

    f2817b2
  16. jamienicol
    added a commit that references this issue on Mar 5, 2025

    Bug 1950533 [wpt PR 50955] - [IndexedDB] Add more detached array buff…

    bda94e3
  17. glandium
    added a commit that references this issue on Apr 1, 2025

    Bug 1950533 [wpt PR 50955] - [IndexedDB] Add more detached array buff…

    b511b38
  18. evanstade
    added a commit that references this issue on Oct 29, 2026

    "Convert a value to a key" should return invalid for detached array b…

    This issue will close once commit c659eb3 is merged into the 'main' branch.
    c659eb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @SteveBeckerMSFT
    SteveBeckerMSFT

Labels

needs-pr

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.