Page MenuHomePhabricator

Commiting changes in languages not yet part of the store
Closed, ResolvedPublicBUG REPORT

Description

GIVEN I am on an Entity page
AND the entity exists and is editable
AND the entity does not have any information in the primary language
WHEN I set the label in the primary language (es)
THEN an error is thrown "TypeError: "can't define property "es": Array is not extensible""

Presumably due to
https://vuex.vuejs.org/guide/mutations.html#mutations-follow-vue-s-reactivity-rules

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 8 2019, 12:36 PM
Pablo-WMDE updated the task description. (Show Details)Apr 8 2019, 12:39 PM
Pablo-WMDE updated the task description. (Show Details)Apr 8 2019, 12:59 PM

Change 502446 had a related patch set uploaded (by Matthias Geisler; owner: Matthias Geisler):
[wikibase/termbox@master] BugFix for Array is not extensible

https://gerrit.wikimedia.org/r/502446

@Pablo-WMDE @Jakob_WMDE I heard on IRC that you found performance problems with using spread and replace on the entity mutations. Is that the case? If so I guess we need to use Vue.set but otherwise I think we might want to use spread for consistency, readability lack of dark-arts etc..

@Matthias_Geisler_WMDE said: "if you need more than one line you are doing it wrong", i.e. either 1 Vue.set() to add an individual property or 1 use of the spread operator to add a bunch of them.

Change 502826 had a related patch set uploaded (by Jakob; owner: Jakob):
[wikibase/termbox@master] Replace empty arrays with empty objects in EntityInitializer

https://gerrit.wikimedia.org/r/502826

Change 502446 merged by jenkins-bot:
[wikibase/termbox@master] Bug Fix for Array is not extensible when adding keys to state objects

https://gerrit.wikimedia.org/r/502446

Change 502826 merged by jenkins-bot:
[wikibase/termbox@master] Replace empty arrays with empty objects in EntityInitializer

https://gerrit.wikimedia.org/r/502826

Jakob_WMDE closed this task as Resolved.Apr 23 2019, 12:20 PM