Files
coucou/scripts/test-question-queue.sh
NikitaBulichevandClaude Opus 5.5 20f72efea3 QuestionQueue: questions from several sessions wait side by side
A pure FIFO of pending AskUserQuestions, like ApprovalQueue: one per
session (a session asking again takes its older question's place and
slot), up to 5. Each question gets a slot on its pill for the iPhone: the
pill's own record for the first, "<pill>#2"… for the others, kept for the
question's life. QuestionQueue.question(answering:onRecord:…) finds the
question an iPhone answer is for, by fingerprint and record, so two
sessions asking the very same question each get their own answer.

Tests in scripts/test-question-queue.sh, in the Build workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:23:22 +00:00

9 lines
361 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-question-queue.XXXXXX")"
trap 'rm -rf "$TEST_DIR"' EXIT
swiftc NotchBuddy/Sources/App/QuestionQueue.swift NotchBuddy/Sources/App/AskQuestion.swift \
tests/QuestionQueueTests.swift -o "$TEST_DIR/question-queue-tests"
"$TEST_DIR/question-queue-tests"