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

Config changes from saved sessions do not restore #917

Closed
jw3 opened this issue Oct 4, 2023 · 1 comment · Fixed by #918
Closed

Config changes from saved sessions do not restore #917

jw3 opened this issue Oct 4, 2023 · 1 comment · Fixed by #918
Labels
bug Something isn't working
Milestone

Comments

@jw3
Copy link
Member

jw3 commented Oct 4, 2023

Test

  1. Save a session file that contains a trust, rule, and config modification.
  2. Restore
  3. Observe that the trust and rule are restored while the config quietly is not.

The trust record is serialized as a dict, the rule and config as strings.

The application is attempting to use nested exception handling to derive the flavor of string being deserialized from the session file.

https://github.com/ctc-oss/fapolicy-analyzer/blob/master/fapolicy_analyzer/ui/changeset_wrapper.py#L35-L59

The root deficiency here lies in the format of the session file. A new format that includes a type discriminator should be defined. At that time the deserialize function can be rewritten to match.

@jw3 jw3 added the bug Something isn't working label Oct 4, 2023
@jw3 jw3 added this to the v1.2 milestone Oct 4, 2023
@jw3 jw3 changed the title Config changes added to sessions files are unpredictable Config changes from saved sessions do not restore Oct 4, 2023
@tparchambault
Copy link
Contributor

tparchambault commented Oct 4, 2023

We originally used a dict because of the supported translation to/fro json. Can we embed the strings into a dict so that we can maintain the json session file format? *-ish? Maybe that's a higher level dict now comprised of two sub-dicts? In any event, I'd like to maintain the json file format if possible.

@jw3 jw3 closed this as completed in #918 Oct 5, 2023
jw3 added a commit that referenced this issue Oct 5, 2023
Implements a new format for changesets to include a type discriminator
which assists with deserialization.

Previously the deserialization was deriving the value type by the type
of the serialized data, but this has issues when scaling to support
additional types.

Closes #917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants