FLUID-6249: model relay system cannot distinguish between different sources of initial values

Metadata

Source
FLUID-6249
Type
Bug
Priority
Major
Status
Open
Resolution
N/A
Assignee
N/A
Reporter
Justin Obara
Created
2018-02-22T08:11:57.248-0500
Updated
2021-07-29T01:51:57.661-0400
Versions
  1. 3.0
Fixed Versions
  1. 5.0
Component
  1. Framework
  2. Prefs Framework

Description

While implementing the remoteModel component into the prefs framework (FLUID-6209) I've encountered an issue where the default model value for the panelIndex (for arrow scrolling in the small screen mobile view), causes a conflict. If a default value is provided for the panelIndex, the value from the store will not be used. If the "init" source is excluded via model relay, the store value will be used, however, the default model value will never be used.

See conversation on the FLUID-6209 PR ( https://github.com/fluid-project/infusion/pull/867#pullrequestreview-86399946 )

Comments

  • Justin Obara commented 2018-02-23T09:39:15.106-0500

    Regarding the work in FLUID-6209 it seems that the default panelIndex model value is being saved to the store when the model is instantiated. This is even the case if the modelListener for saving the panelIndex is set to exclude init. It seems that this is happening because the initial model values for the preferences are also being set in the model, which also triggers a save. However, those initial preference values are explicitly ignored. However, any component state such as the panel index will be saved to the store. The effect of this is to replace the previously stored value with the default value.

    For example, at the time of save, the model will look something like the following. Note that the default preference values are stripped out by the prefs framework before saving the model to the store.

    {
        panelIndex: 0,
        preferences: {
            contrast: "default"
        }
    }