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

Mutations are showing out of order when committing actions from a plugin #678

Open
DarynHolmes opened this issue Apr 25, 2018 · 2 comments · Fixed by vuejs/vuex#1358 · May be fixed by rpocklin/phoenix#2
Open

Mutations are showing out of order when committing actions from a plugin #678

DarynHolmes opened this issue Apr 25, 2018 · 2 comments · Fixed by vuejs/vuex#1358 · May be fixed by rpocklin/phoenix#2
Labels

Comments

@DarynHolmes
Copy link

DarynHolmes commented Apr 25, 2018

Version

4.1.4

Browser and OS info

Version 65.0.3325.181 (Official Build) (64-bit) - Windows 10

Steps to reproduce

When calling an action from a Vuex plugin, the order of the mutations are listed out of order in Vue Devtools. The log statements from the built-in logger seem correct, but the list in Devtools is incorrect.

This can be replicated by running the code in this repo: https://github.com/DarynHolmes/vue-devtools-order

Run that with: npm run serve
Click the button: Add Error
Compare the output from the built-in vuex logger to the Vue devtools display of mutations.

What is expected?

Base State

addError

removeError

What is actually happening?

Base State

removeError

addError


It appears that the Dev Tools are not using enough precision when ordering by time.

@Akryum Akryum added bug need team repro We acknowledged your report and will soon try to reproduce it labels Jul 25, 2018
@simplesmiler
Copy link
Member

Confirmed that this happens with the latest beta.

@simplesmiler
Copy link
Member

Happens because devtools adds its subscriber after the application subscribers are added.

  1. Mutation A goes through the application subscriber, and subscriber commits mutation B.
  2. Mutation B goes through the application subscriber, nothing interesting happens.
  3. Mutation B goes through the devtools subscriber, gets added to history.
  4. Mutation A goes through the devtools subscriber, gets added to history.

The solution would be to prepend the devtools subscriber, so it would be the first in the chain. Currently vuex does not have an API to prepend subscribers.

simplesmiler added a commit to simplesmiler/vuex that referenced this issue Jul 31, 2018
@simplesmiler simplesmiler removed the need team repro We acknowledged your report and will soon try to reproduce it label Jul 31, 2018
ktsn added a commit to vuejs/vuex that referenced this issue Apr 23, 2020
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
@dependabot dependabot bot linked a pull request Mar 17, 2021 that will close this issue
freedeveloper000 added a commit to freedeveloper000/vuex that referenced this issue Feb 28, 2022
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
OneDev0411 added a commit to OneDev0411/Vuex that referenced this issue May 5, 2022
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
topstack1226 pushed a commit to topstack1226/hospital-frontend that referenced this issue Jan 3, 2023
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
humilitypatience added a commit to humilitypatience/vue-workspace that referenced this issue May 21, 2023
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
ZinedineDumas added a commit to ZinedineDumas/Vue-Vuex that referenced this issue Jul 17, 2023
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
sphinxDevVic added a commit to sphinxDevVic/vuex that referenced this issue Feb 11, 2024
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
profreelancer222 added a commit to profreelancer222/VueSocial that referenced this issue Feb 20, 2024
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
UltraDEV007 added a commit to UltraDEV007/vuex_project that referenced this issue Apr 26, 2024
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
Rarewolf626 added a commit to Rarewolf626/vuex that referenced this issue Aug 19, 2024
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
Watcher919 pushed a commit to Watcher919/Vue-Vuex that referenced this issue Aug 28, 2024
* Add prepend option to subscribe

* Prepend devtools subscribe handler to fix vuejs/devtools-v6#678

Co-authored-by: Katashin <[email protected]>
madcodelife pushed a commit to madcodelife/prerender-demo that referenced this issue Nov 15, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [vuex](https://redirect.github.com/vuejs/vuex) | [`3.1.1` ->
`3.6.2`](https://renovatebot.com/diffs/npm/vuex/3.1.1/3.6.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/vuex/3.6.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vuex/3.6.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vuex/3.1.1/3.6.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vuex/3.1.1/3.6.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vuejs/vuex (vuex)</summary>

###
[`v3.6.2`](https://redirect.github.com/vuejs/vuex/releases/tag/v3.6.2)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.6.1...v3.6.2)

##### Bug Fixes

- **build:** fix wrong path name for the export module
([679313b](https://redirect.github.com/vuejs/vuex/commit/679313bf5e4de066f340a06ef9bfe08d1536fadd))

###
[`v3.6.1`](https://redirect.github.com/vuejs/vuex/releases/tag/v3.6.1)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.6.0...v3.6.1)

##### Bug Fixes

- fix tree shaking notworking in webpack bundle
([#&#8203;1906](https://redirect.github.com/vuejs/vuex/issues/1906))
([1dc2d1f](https://redirect.github.com/vuejs/vuex/commit/1dc2d1f21de42138053ea3281dde05487642a76d))

###
[`v3.6.0`](https://redirect.github.com/vuejs/vuex/releases/tag/v3.6.0)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.5.1...v3.6.0)

##### Bug Fixes

- stop throwing an error on `hasModule` when parent does not exists
([#&#8203;1850](https://redirect.github.com/vuejs/vuex/issues/1850))
([#&#8203;1851](https://redirect.github.com/vuejs/vuex/issues/1851))
([12aabe4](https://redirect.github.com/vuejs/vuex/commit/12aabe4cc470916d40691097dcb95badb8212f5c))

##### Features

- **types:** adding logger type for logger plugin
([#&#8203;1853](https://redirect.github.com/vuejs/vuex/issues/1853))
([cb3198d](https://redirect.github.com/vuejs/vuex/commit/cb3198d5998bdb11ef05dfa5ef98d5c5fa873089))
- **build:** enable named esm module import on node.js >= 14
([#&#8203;1872](https://redirect.github.com/vuejs/vuex/issues/1872))
([acddab2](https://redirect.github.com/vuejs/vuex/commit/acddab20769d1bb6125f2da78ac47561c682fc98))

###
[`v3.5.1`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#351-2020-06-29)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.5.0...v3.5.1)

###
[`v3.5.0`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#350-2020-06-29)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.4.0...v3.5.0)

###
[`v3.4.0`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#340-2020-05-11)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.3.0...v3.4.0)

###
[`v3.3.0`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#330-2020-04-25)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.2.0...v3.3.0)

##### Bug Fixes

- Prepend devtool handler
([#&#8203;1358](https://redirect.github.com/vuejs/vuex/issues/1358))
([a39d076](https://redirect.github.com/vuejs/vuex/commit/a39d0767e4041cdd5cf8050774106c01d39024e0)),
closes
[vuejs/devtools-v6#678](https://redirect.github.com/vuejs/vue-devtools/issues/678)
- **types:** Add `devtools` to store options type
([#&#8203;1478](https://redirect.github.com/vuejs/vuex/issues/1478))
([38c11dc](https://redirect.github.com/vuejs/vuex/commit/38c11dcbaea7d7e661a1623cabb5aef7c6e47ba7))

##### Features

- Add `prepend` option for `subscribe` and `subscribeAction`
([#&#8203;1358](https://redirect.github.com/vuejs/vuex/issues/1358))
([a39d076](https://redirect.github.com/vuejs/vuex/commit/a39d0767e4041cdd5cf8050774106c01d39024e0))
- **logger:** `createLogger` can optionally log actions
([#&#8203;987](https://redirect.github.com/vuejs/vuex/issues/987))
([18be128](https://redirect.github.com/vuejs/vuex/commit/18be128ad933d1fca6da05c060f7664ce0c819ae))

###
[`v3.2.0`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#320-2020-04-19)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.1.3...v3.2.0)

##### Features

- add Store#hasModule(path) API
([#&#8203;834](https://redirect.github.com/vuejs/vuex/issues/834))
([d65d142](https://redirect.github.com/vuejs/vuex/commit/d65d14276e87aca17cfbd3fbf4af9e8dbb808f24))

####
[3.1.3](https://redirect.github.com/vuejs/vuex/compare/v3.1.2...v3.1.3)
(2020-03-09)

##### Bug Fixes

- Prevent invalidating subscription iterator
([#&#8203;1438](https://redirect.github.com/vuejs/vuex/issues/1438))
([e012653](https://redirect.github.com/vuejs/vuex/commit/e0126533301febf66072f1865cf9a77778cf2176))

####
[3.1.2](https://redirect.github.com/vuejs/vuex/compare/v3.1.1...v3.1.2)
(2019-11-10)

##### Bug Fixes

- tweak mapping helper warning message
([#&#8203;1641](https://redirect.github.com/vuejs/vuex/issues/1641))
([e60bc76](https://redirect.github.com/vuejs/vuex/commit/e60bc76154bb05c12b24342617b946d9a6e2f476))
- **types:** avoid broadening vue instance type when using map helpers
([#&#8203;1639](https://redirect.github.com/vuejs/vuex/issues/1639))
([9a96720](https://redirect.github.com/vuejs/vuex/commit/9a9672050bcfee198c379069ec0e1b03ca6cb965))
- add warnings when the different namespaced modules has the same names…
([#&#8203;1554](https://redirect.github.com/vuejs/vuex/issues/1554))
([91f3e69](https://redirect.github.com/vuejs/vuex/commit/91f3e69ed9e290cf91f8885c6d5ae2c97fa7ab81))
- Should vuex mapState print error message
[#&#8203;1093](https://redirect.github.com/vuejs/vuex/issues/1093)
([#&#8203;1297](https://redirect.github.com/vuejs/vuex/issues/1297))
([e5ca2d5](https://redirect.github.com/vuejs/vuex/commit/e5ca2d52e89a126bd48bd8a6003be77379960ea9))
- Warn about conflicts between state and module
([#&#8203;1365](https://redirect.github.com/vuejs/vuex/issues/1365))
([538ee58](https://redirect.github.com/vuejs/vuex/commit/538ee5803bbca2fc8077208fb30c8d56d8be5cae))
- **docs:** Clearify state object type
([#&#8203;1601](https://redirect.github.com/vuejs/vuex/issues/1601))
([de06f76](https://redirect.github.com/vuejs/vuex/commit/de06f76380e7429489c0eb15acc8e0b34a383860))

##### Performance Improvements

- Implementing a cache for the gettersProxy object creation
([#&#8203;1546](https://redirect.github.com/vuejs/vuex/issues/1546))
([4003382](https://redirect.github.com/vuejs/vuex/commit/40033825b7259c2e9b702bdf94e0b24ed4511d7c))

####
[3.1.1](https://redirect.github.com/vuejs/vuex/compare/v3.1.0...v3.1.1)
(2019-05-08)

##### Bug Fixes

- Memory leak happening while using registerModule/u…
([#&#8203;1508](https://redirect.github.com/vuejs/vuex/issues/1508))
([cb9986a](https://redirect.github.com/vuejs/vuex/commit/cb9986ae5a62e002a1d876e881ee5f31dd410888)),
closes [issue#1507](https://redirect.github.com/issue/issues/1507)
- **types:** Make mutation and action payload optional in definition
file
([#&#8203;1517](https://redirect.github.com/vuejs/vuex/issues/1517))
([0e109e2](https://redirect.github.com/vuejs/vuex/commit/0e109e2a38dafdc0c2bd6bd3892bc66cfe252b16)),
closes
[#&#8203;1491](https://redirect.github.com/vuejs/vuex/issues/1491)

##### Features

- **devtool:** allow usage in non-browser environments
([#&#8203;1404](https://redirect.github.com/vuejs/vuex/issues/1404))
([665455f](https://redirect.github.com/vuejs/vuex/commit/665455f8daf8512e7adbf63c2842bc0b1e39efdb))
- **esm build:** build ES modules for browser
([#&#8203;1533](https://redirect.github.com/vuejs/vuex/issues/1533))
([d7c7f98](https://redirect.github.com/vuejs/vuex/commit/d7c7f9844831f98c5c9aaca213746c4ccc5d6929))

###
[`v3.1.3`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#313-2020-03-09)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.1.2...v3.1.3)

##### Bug Fixes

- Prevent invalidating subscription iterator
([#&#8203;1438](https://redirect.github.com/vuejs/vuex/issues/1438))
([e012653](https://redirect.github.com/vuejs/vuex/commit/e0126533301febf66072f1865cf9a77778cf2176))

###
[`v3.1.2`](https://redirect.github.com/vuejs/vuex/blob/HEAD/CHANGELOG.md#312-2019-11-10)

[Compare
Source](https://redirect.github.com/vuejs/vuex/compare/v3.1.1...v3.1.2)

##### Bug Fixes

- tweak mapping helper warning message
([#&#8203;1641](https://redirect.github.com/vuejs/vuex/issues/1641))
([e60bc76](https://redirect.github.com/vuejs/vuex/commit/e60bc76154bb05c12b24342617b946d9a6e2f476))
- **types:** avoid broadening vue instance type when using map helpers
([#&#8203;1639](https://redirect.github.com/vuejs/vuex/issues/1639))
([9a96720](https://redirect.github.com/vuejs/vuex/commit/9a9672050bcfee198c379069ec0e1b03ca6cb965))
- add warnings when the different namespaced modules has the same names…
([#&#8203;1554](https://redirect.github.com/vuejs/vuex/issues/1554))
([91f3e69](https://redirect.github.com/vuejs/vuex/commit/91f3e69ed9e290cf91f8885c6d5ae2c97fa7ab81))
- Should vuex mapState print error message
[#&#8203;1093](https://redirect.github.com/vuejs/vuex/issues/1093)
([#&#8203;1297](https://redirect.github.com/vuejs/vuex/issues/1297))
([e5ca2d5](https://redirect.github.com/vuejs/vuex/commit/e5ca2d52e89a126bd48bd8a6003be77379960ea9))
- Warn about conflicts between state and module
([#&#8203;1365](https://redirect.github.com/vuejs/vuex/issues/1365))
([538ee58](https://redirect.github.com/vuejs/vuex/commit/538ee5803bbca2fc8077208fb30c8d56d8be5cae))
- **docs:** Clearify state object type
([#&#8203;1601](https://redirect.github.com/vuejs/vuex/issues/1601))
([de06f76](https://redirect.github.com/vuejs/vuex/commit/de06f76380e7429489c0eb15acc8e0b34a383860))

##### Performance Improvements

- Implementing a cache for the gettersProxy object creation
([#&#8203;1546](https://redirect.github.com/vuejs/vuex/issues/1546))
([4003382](https://redirect.github.com/vuejs/vuex/commit/40033825b7259c2e9b702bdf94e0b24ed4511d7c))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/madcodelife/prerender-demo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants