Skip to content

Commit

Permalink
Return 409 conflict for concurrent group membership update (ModelExce…
Browse files Browse the repository at this point in the history
…ption)
  • Loading branch information
cgeorgilakis-grnet committed Feb 26, 2025
1 parent 37dd0b2 commit 28ced70
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes in keycloak-group-management will be documented in this file
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.6] - 2025-02-25

### Fixed
- Return 409 conflict for concurrent group membership update

## [1.5.5] - 2025-02-25

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<quarkus.version>3.2.7.Final</quarkus.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<agm-version>1.5.5</agm-version>
<agm-version>1.5.6</agm-version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.keycloak.email.EmailException;
import org.keycloak.models.GroupModel;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.ModelException;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.models.utils.ModelToRepresentation;
Expand Down Expand Up @@ -129,7 +130,7 @@ public Response updateMember(UserGroupMembershipExtensionRepresentation rep) {
});
} catch (EmailException e) {
ServicesLogger.LOGGER.failedToSendEmail(e);
} catch (OptimisticLockException | StaleObjectStateException e) {
} catch (ModelException | OptimisticLockException | StaleObjectStateException e) {
e.printStackTrace();
return Response.status(Response.Status.CONFLICT).entity(String.format("Concurrent modification detected: conflicting group membership update for user %s in group %s.", member.getUser().getUsername(), group.getName())).build();
}
Expand Down

0 comments on commit 28ced70

Please sign in to comment.