Skip to content

Fix PATCH /account to support clearing optional fields#42

Merged
v0l merged 5 commits into
masterfrom
copilot/fix-clear-account-fields
Feb 9, 2026
Merged

Fix PATCH /account to support clearing optional fields#42
v0l merged 5 commits into
masterfrom
copilot/fix-clear-account-fields

Conversation

Copilot AI commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Fix: Allow clearing optional account fields via PATCH /account

Implementation Complete

  • Analyze current account PATCH endpoint implementation
  • Implement Option<Option> pattern with custom deserializer
  • Update AccountPatchRequest model to support clearing fields
  • Update v1_patch_account endpoint logic to handle clearing
  • Test the changes with comprehensive unit tests
  • Run code review (all feedback addressed)
  • Run security scan (0 alerts)
  • Rebased cleanly on latest master (7e66556)
  • Complete implementation

Commits in this PR

  1. Fix account field clearing in PATCH endpoint (6d29d2a)
  2. Move deserialize_nullable_option to lnvps_api_common (e91a525)
  3. Fix deserialize_with to use lnvps_api_common crate path (9ae29b3)

Summary

Successfully fixed the issue where users could not clear optional account fields via PATCH /account.

Behavior:

  • Omit field → preserve existing value
  • Send null → clear value
  • Send value → update value

Technical Implementation

  • Custom deserializer deserialize_nullable_option in lnvps_api_common
  • Uses Option<Option<T>> pattern to distinguish three states
  • Conditional update logic in v1_patch_account endpoint

Latest Rebase

Branch cleanly rebased on master commit 7e66556 (chore: cleanup proxmox results), incorporating all latest changes including proxmox cleanup improvements.

Security Summary

No vulnerabilities detected by CodeQL analysis.

Original prompt

This section details on the original issue you should resolve

<issue_title>Clearing account fields doesnt work</issue_title>
<issue_description>Users are unable to remove email details by updating account</issue_description>

<agent_instructions>Then calling PATCH /account it should be possible to remove the optional fields </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI assigned Copilot and v0l Feb 9, 2026
Copilot AI changed the title [WIP] Fix issue with clearing account fields Fix PATCH /account to support clearing optional fields Feb 9, 2026
Copilot AI requested a review from v0l February 9, 2026 09:41
Comment thread lnvps_api/src/api/model.rs Outdated
@v0l
v0l marked this pull request as ready for review February 9, 2026 13:59
@v0l

v0l commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

@copilot rebase this pr

Copilot AI commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot rebase this pr

I've rebased the PR on the latest master (b9714b1). The branch now includes all recent master changes including the pipeline spawn VM feature and error handling improvements. All 3 functional commits have been preserved with the changes intact.

Copilot AI requested a review from v0l February 9, 2026 14:03
@v0l

v0l commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

@copilot rebase again

Copilot AI commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot rebase again

Rebased on latest master (a582cc6 - fix: flapping tests). All 3 functional commits are preserved with the correct changes intact.

@v0l

v0l commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

@copilot rebase again

Copilot stopped work on behalf of v0l due to an error February 9, 2026 14:43
Copilot AI and others added 4 commits February 9, 2026 14:43
Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
@v0l
v0l force-pushed the copilot/fix-clear-account-fields branch from cba05d4 to b2e0cd9 Compare February 9, 2026 14:43
@v0l
v0l merged commit df6f5c8 into master Feb 9, 2026
1 check passed
@v0l
v0l deleted the copilot/fix-clear-account-fields branch February 9, 2026 15:04
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.

Clearing account fields doesnt work

2 participants