Skip to content

fix: [DHIS2-13020][DHIS2-21871] Preserve WL sharing on update and fix 409 for non-owners - #4702

Open
henrikmv wants to merge 2 commits into
masterfrom
hv/fix/DHIS2-13020_error-on-update-view-when-view-edit-access
Open

fix: [DHIS2-13020][DHIS2-21871] Preserve WL sharing on update and fix 409 for non-owners#4702
henrikmv wants to merge 2 commits into
masterfrom
hv/fix/DHIS2-13020_error-on-update-view-when-view-edit-access

Conversation

@henrikmv

@henrikmv henrikmv commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This PR fixes two bugs affecting Working List views DHIS2-13020 and DHIS2-21871:

  • 409 conflict when a non-owner user with edit access clicks Update view
  • Sharing settings silently reset when any user saves changes to a view

Both were caused by sending legacy sharing fields (externalAccess, publicAccess, user, userAccesses, userGroupAccesses) that the backend no longer processes on PUT.

The fix replaces these with the sharing object across all three working list types (Event, TEI, Program Stage).

# API fields query
- fields: '...,externalAccess,publicAccess,
-   user[id,username],userAccesses,
-   userGroupAccesses'
+ fields: '...,sharing'

# Update payload (SharingDialog)
- { externalAccess, publicAccess,
-   userAccesses, userGroupAccesses }
+ { sharing: { owner, public,
+   external, users, userGroups } }

devin-ai-integration[bot]

This comment was marked as resolved.

@henrikmv henrikmv changed the title fix: [DHIS2-13020] 409 on update WL view to the user with view and edit access fix: [DHIS2-13020][DHIS2-21871] send sharing object in working list PUT to prevent sharing reset and 409 for non-owners Aug 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

Open in Devin Review

@henrikmv henrikmv changed the title fix: [DHIS2-13020][DHIS2-21871] send sharing object in working list PUT to prevent sharing reset and 409 for non-owners fix: [DHIS2-13020][DHIS2-21871] Preserve working list sharing on update and fix 409 for non-owners Aug 18, 2026
@henrikmv
henrikmv marked this pull request as ready for review August 18, 2026 11:28
@henrikmv
henrikmv requested a review from a team as a code owner August 18, 2026 11:28
@github-actions

Copy link
Copy Markdown

@henrikmv henrikmv changed the title fix: [DHIS2-13020][DHIS2-21871] Preserve working list sharing on update and fix 409 for non-owners fix: [DHIS2-13020][DHIS2-21871] Preserve WL sharing on update and fix 409 for non-owners Aug 18, 2026

@simonadomnisoru simonadomnisoru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants