public Mono<Boolean> updateOnlineUsersStatus(
            @NotEmpty Set<Long> userIds,
            @NotNull UserStatus userStatus) {
        try {
            Validator.notEmpty(userIds, "userIds");
            Validator.notNull(userStatus, "userStatus");
            Validator.notEquals(userStatus,
                    UserStatus.UNRECOGNIZED,
                    "The user status must not be UNRECOGNIZED");
            Validator.notEquals(userStatus,
                    UserStatus.OFFLINE,
                    "The user status must not be OFFLINE");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        int size = userIds.size();
        return switch (size) {
            case 0 -> PublisherPool.TRUE;
            case 1 -> updateOnlineUserStatusIfPresent(userIds.iterator()
                    .next(), userStatus);
            default -> {
                List<Mono<Boolean>> monos = new ArrayList<>(userIds.size());
                for (Long userId : userIds) {
                    monos.add(updateOnlineUserStatusIfPresent(userId, userStatus));
                }
                yield Flux.merge(monos)
                        .all(value -> value);
            }
        };
    }
Note that both online and offline information will be cached
turms-server-common/src/main/java/im/turms/server/common/domain/session/service/UserStatusService.java