public Mono<DeleteResult> deleteUserRoles(@Nullable Set<Long> groupIds) {
        if (groupIds == null) {
            return userRoleRepository.deleteByNotIds(Set.of(DEFAULT_USER_ROLE_ID));
        }
        if (groupIds.contains(DEFAULT_USER_ROLE_ID)) {
            return Mono.error(ResponseException.get(ResponseStatusCode.ILLEGAL_ARGUMENT,
                    "The default user role cannot be deleted"));
        }
        return userRoleRepository.deleteByIds(groupIds)
                .doOnNext(deleteResult -> {
                    // Though the latest records will be synced in the watch callback,
                    // we still need to invalid dirty cache immediately, so the subsequent query
                    // won't get outdated records
                    for (Long groupId : groupIds) {
                        idToRole.remove(groupId);
                    }
                });
    }
@implNote Note that we don't need to remove corresponding groups in {@link #idToRole} because
          their data will be synced in the watch callback.
turms-service/src/main/java/im/turms/service/domain/user/service/UserRoleService.java