Skip to content

Attempted config merge of list and dict clobbers dict #191

@vidartf

Description

@vidartf

Description

In the lab handler, we attempt to merge the page_config_data set on the webapp with the readout from the settings dir:

recursive_update(page_config, get_page_config(labextensions_path, settings_dir, logger=self.log))

The code that reads out data from the config file includes a part that converts dicts to lists:

# Convert dictionaries to lists to give to the front end
for (key, value) in page_config.items():
if isinstance(value, dict):
page_config[key] = [subkey for subkey in value if value[subkey]]

However, this is run before the attempted merge with serverapp data. So, if someone has set dict data for a key (e.g. "disabledExtensions" on the serverapp data, it gets clobbered by the (potentially empty) list from the settings dir.

Expected behavior

The conversion from dict to list happens after all merging has happened. As recursive_update does not merge lists, this seems the most reasonable option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions