Skip to content

Modifying items of an extended array does not trigger re-computation #11759

@scottbedard

Description

@scottbedard

Vue version

3.5.0-rc.1

Link to minimal reproduction

https://play.vuejs.org/#eNp9kl1r2zAUhv/KQTd2IHM2ut0YO11XerFdbGPbpWA48knqVJaEPtIO4/++Iwm3KZSAjdD5ePXo1ZnYjTHVKSCrWeOEHYwHhz6YLVfDaLT1MIHQowke+zVY7IQfTggz7K0eoaDOgiuuhOycg1stJVKBVoBPHlXv4Mba7h9MXAHsB9WXY+fFPdpVDgEp+mAVuGDQVq8qYn7mij6S18oRmO88QvtMUSYNfz+og6tB4eMZQDnBXusaigJmkor/IrPrLIkslyrLFbTbrF1lrcyhd8eYoKUiJWjbFgpqLVYk1WyyV+QSbTyORlI77QAaY3E7TWRbklzH4+p05vU1FEp74gqqJyyY52YTq6MINe6C9+TcZyEH8dBydglplZkyEWfpZIDUCSMmuU3Wo1SzOSNka+YdGbEfDtXRaUUPn2zkLDoySLQ/TDTQcVYvj8RZJ6V+/JZi3gZcL3F6KfHwRvzonmKMs58WHdoTcvac8509oM/pu9/faVLOkqPug6TqC8lf6LQMkTGXfSE7CfusLtF+TeNL5v1xd3EY3XKpCJqGK9VzRjN8e+HqL7hX1cdlKMnFvye0UZMMvKo+Ve/fWVF9YPN/u1QbwA==

Steps to reproduce

  1. Create a class that extends Array, and add a method that calls super
  2. Create a computed value that uses that method to find an item
  3. Change a property on the item

What is expected?

The computed value should update

What is actually happening?

Computed value does not re-evaluate

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 233.67 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 9.7.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 128.0.6613.113
    Firefox Nightly: 129.0a1
    Safari: 17.4.1

Any additional comments?

This was working in beta.1, and stopped working in beta.2. This failure is different from versions >= beta.3 though. In beta.2, the source value does not update, so it's unclear if the computed property would have re-evaluated.

This regression is likely related to fixes from earlier tickets,
#11570
#11573
#11628 ← this was very similar, but it accessed item by index instead of method

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.🐞 bugSomething isn't workingscope: reactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions