Skip to content

The per-user configuration directory should not be created by JsonConfigFileAccessor until a write operation to user config file is requested #2037

Closed

Description

JsonConfigFileAccessor tries to create the per-user configuration directory at initialization, even if on configuration file is put there. And currently both read and write operations targeting the user scope settings will trigger the creation of the directory.

There is an edge case that we have to deal with -- what if somehow it fails to create the directory? The current implementation is to let the exception pop up, and reply on the caller to handle this situation. However, if the caller only issues a read request, it shouldn't matter that the configuration directory cannot be created, because that means no configuration file is there, so a default value should be returned for the setting, such as null for a string value.

IMHO, The per-user configuration directory should only be created when powershell has to -- only write requests to the user settings would trigger the creation of the directory.

Activity

  1. added
    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif
    on Aug 23, 2016
  2. andyleejordan commented on Sep 19, 2016

    @andyleejordan
    Member

    Heh, yes this is an edge case we ran into pretty quickly, in both #2205 and #2299.

  3. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    Area-SideBySiderelated to ability to run PS7 side-by-side with WinPS or different versions of PS7
    and removed
    WG-Enginecore PowerShell engine, interpreter, and runtime
    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif
    on Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-SideBySiderelated to ability to run PS7 side-by-side with WinPS or different versions of PS7Issue-Enhancementthe issue is more of a feature request than a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions