[Fix] PR review feedback disappears during pull request creation - #1262
[Fix] PR review feedback disappears during pull request creation#1262roomote-roomote[bot] wants to merge 9 commits into
Conversation
|
1 issue outstanding. See task
Reviewed 510135a |
|
Fixed the stale repair cleanup race in commit
Passed focused SDK tests (84), BullMQ tests (31), GitHub webhook tests (53), SDK/BullMQ/API typechecks, formatting, and repository pre-push checks. Visual proof is not applicable to this Redis/Lua concurrency behavior. |
| now = Date.now(), | ||
| }: { now?: number } = {}): Promise<void> { | ||
| const redis = getRedis(); | ||
| const members = await redis.zrangebyscore( |
There was a problem hiding this comment.
The bounded scan repeatedly reads the same first 100 overdue members. If Queue.add remains down for all of them, this catch leaves their unchanged scores in the ZSET; each one-minute repair run selects those same members again and never reaches later due repair intents. A busy outage with over 100 affected PRs therefore leaves later retained feedback unscheduled until its 15-minute TTL expires. Reschedule failed entries (or use a cursor) so a failed batch cannot starve the rest of the index.
There was a problem hiding this comment.
This remains unresolved in e7dfd55: the Queue.add failure path only logs and leaves the member's score unchanged. Every subsequent ZRANGEBYSCORE ... LIMIT 0 100 therefore selects the same failed entries before later due intents, so an outage affecting more than 100 PRs can still leave the later orphan lists unscheduled until their 15-minute TTL expires. Reschedule failed members to a future score (or advance a persisted cursor) before returning.
|
Closing in favor of a single Postgres-backed durable event/outbox design. This branch’s Redis replay ownership overlaps with queue-recovery behavior, which can give two mechanisms ownership of the same failed delivery. That is not an invariant we can prove or an architecture we want to maintain. |
What changed
REDIS_URLis unset locally.REDIS_URLthrough Turborepo's strict environment allowlist so the CI test task reaches its Redis service on port 6379.Why this change was made
Review webhooks can arrive before Roomote commits the task-to-pull-request association. Repair intent cleanup must not delete a newer intent recorded concurrently after a stale read, or retained feedback can again become stranded until expiry.
The real-Redis test previously replaced the CI-provided Redis endpoint with a local-only port, and Turborepo then filtered the corrected endpoint before starting the SDK test. The test therefore timed out against port 16379 in GitHub Actions even though CI's Redis service was healthy on port 6379.
PR #1265 remains an unmerged draft and repairs task-level pending notification jobs. This PR uses a separate orphan-association replay repair namespace and has no dependency on #1265.
Impact
Review feedback arriving concurrently with pull-request creation can recover after repeated replay enqueue outages without another webhook, including when a stale repair sweep races with a newer intent. The repair worker remains bounded to 100 due intents per minute and the existing 15-minute orphan TTL. CI now preserves its configured Redis endpoint through the Turbo test boundary, while local runs retain the port 16379 fallback. There is no product or runtime behavior change from the CI configuration fix.