Skip to content

Adjust PrivMX policy to fix crashes in app's task list screen#35

Merged
bwisniewski26 merged 2 commits into
mainfrom
PolicyAdjustment
May 8, 2025
Merged

Adjust PrivMX policy to fix crashes in app's task list screen#35
bwisniewski26 merged 2 commits into
mainfrom
PolicyAdjustment

Conversation

@bwisniewski26
Copy link
Copy Markdown
Contributor

No description provided.

@bwisniewski26 bwisniewski26 requested review from Copilot and pawl0wski May 7, 2025 09:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses crashes in the app's task list screen by adjusting the PrivMX policy configuration. Key changes include:

  • Adding a default PrivMxPolicy to the context creation process in PrivMxService.
  • Incorporating a new "policy" field in the PrivMxCreateContextParameters to accept policy data.
  • Introducing new policy model classes for thread and thread items to standardize policy structure.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
FamilyVaultServer/Services/PrivMx/PrivMxService.cs Adds default PrivMxPolicy assignment during context creation.
FamilyVaultServer/Services/PrivMx/Models/Parameters/PrivMxCreateContextParameters.cs Includes a new JSON-mapped policy field for input parameters.
FamilyVaultServer/Models/PrivMxPolicy/PrivMxThreadPolicy.cs Introduces a thread-level policy class.
FamilyVaultServer/Models/PrivMxPolicy/PrivMxThreadItemPolicy.cs Defines a default update policy for thread items.
FamilyVaultServer/Models/PrivMxPolicy/PrivMxPolicy.cs Provides a composite policy structure by composing thread policies.

[JsonPropertyName("scope")]
public required string Scope { get; set; }
[JsonPropertyName("policy")]
public PrivMxPolicy Policy = new PrivMxPolicy();
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider converting the public field 'Policy' into a property with { get; set; } for consistency and to align with common patterns used for other request parameters.

Suggested change
public PrivMxPolicy Policy = new PrivMxPolicy();
public PrivMxPolicy Policy { get; set; } = new PrivMxPolicy();

Copilot uses AI. Check for mistakes.
{
public class PrivMxThreadItemPolicy
{

Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Adding XML documentation comments for the 'Update' field would help clarify the intended behavior and expected values, aiding maintainability and clarity for API consumers.

Suggested change
/// <summary>
/// Specifies the update policy for the thread item.
/// </summary>
/// <value>
/// The default value is "all", which indicates that all updates are allowed.
/// Other possible values may depend on the specific implementation.
/// </value>

Copilot uses AI. Check for mistakes.
@bwisniewski26 bwisniewski26 merged commit 46313a5 into main May 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants