You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
removed duplicate challenge-state logic from People and Requests
fixed space filtering for claimless inbound and outbound requests
kept the PR as a draft for product review
Testing
377 focused Vitest tests passed across Claims, People, Requests, Positions, activity reconciliation, coordinator popups, claim cards, and request gating
ESLint passed on every reviewed file
Prettier and git diff --check passed
Local environment note
Full bun run typecheck remains blocked in this worktree by existing shared dependency issues (missing AI SDK, LiveKit, Upstash, and Tiptap modules plus duplicate viem installations). None of the changed files report TypeScript errors.
Schedule refetch when optimistic grace period expires
apps/web/core/debates/hooks.ts:1298
The grace deadline is only evaluated when queryFn runs, but this success path no longer invalidates or schedules another read. If the gateway refetch arrives during the first 10 seconds, it retains the optimistic row and no event fires when the grace expires, so a rejected request can continue blocking until the 30-second poll (or the next focus). Schedule an activity refetch at the grace boundary.
Addressed Copilot review 5310312379’s Previously missed: Schedule refetch when optimistic grace period expires finding. GitHub did not create an inline thread for this finding, so I am recording the disposition here. The finding was correct: the gateway could refetch during the 10-second protection window, retain the optimistic row, and then leave it untouched until the 30-second poll. Fixed in be15302 by scheduling one activity invalidation exactly when the propagation grace expires. I audited every retention/deadline path added by this PR; this was the only grace without a boundary reconciliation. The regression test was added first and failed against the old code because the activity query was never invalidated after 10 seconds, then passed after the fix. This changes only stale/null reconciliation timing from up to 30 seconds to 10 seconds; confirmed server requests and simultaneous inbound/outbound requests remain retained.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Activity cache replacement can discard retained outbound state, and Requests can hide that state behind an unrelated query status.
Review effort: Balanced Findings: None
Previously missed (2)
In code that hasn't changed since last review
Availability updates discard retained outbound challenge state
apps/web/core/debates/hooks.ts:1293
The retained outbound state can still be discarded by the availability mutation. useUpdateDebateAvailability replaces this activity cache with the wire response on success (hooks.ts:753-755), and its rollback can restore a snapshot taken before this challenge was created (hooks.ts:742-751). Because the wire shape has no outbound_challenge, toggling availability after creation—or completing an overlapping toggle—removes this field; when challenge is the simultaneous inbound request, the outbound card and gate disappear. Preserve the latest client-only outbound fields when applying either availability result, or centralize activity cache writes through the same reconciliation logic.
Request query states hide the cancellable outbound challenge
Although this now derives an optimistic outbound challenge independently of the request list, it is rendered inside HubQueryState, whose loading/error branches replace all children (hub-states.tsx:132-185). On a cold Requests load—or whenever the unrelated claim-request query fails—the person request is therefore hidden and cannot be cancelled here even though activity already contains it. Keep the challenge section outside the request-list query state, as the scheduled section and the other tabs’ outbound cards are.
Addressed both Previously missed findings from Copilot review 5310432184. GitHub did not create inline threads for either finding, so the dispositions are recorded here.
Availability updates discard retained outbound challenge state — correct, fixed in 097bc8c. I enumerated both full-replacement paths: the availability success response and an error rollback to a pre-mutation snapshot. Both now overlay the latest client-only outbound_challenge and monotonic cache timestamp instead of discarding them. Separate regressions for success and rollback failed against the prior code, then passed after the fix.
Request query states hide the cancellable outbound challenge — correct, fixed in 097bc8c. I checked both activity-backed directions, not just the reported outbound case. Outbound person challenges remain cancellable while the unrelated claim-request query loads, and inbound person challenges remain actionable if that query errors. The normal content state still uses one shared section renderer, so there is no duplicate Sent/Received implementation. Separate loading/outbound and error/inbound regressions failed against the prior code, then passed after the fix.
These changes preserve behavior already tested on-device; they prevent unrelated availability and claim-request transitions from hiding or erasing that state. Validation: 105 focused tests plus ESLint, Prettier, and git diff --check.
Keep snoozed inbound challenges and newly created outbound challenges independently so activity refreshes cannot reopen the popup, hide the sent card, or enable duplicate requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Linear: GEO-3027
Review notes
masterTesting
git diff --checkpassedLocal environment note
bun run typecheckremains blocked in this worktree by existing shared dependency issues (missing AI SDK, LiveKit, Upstash, and Tiptap modules plus duplicatevieminstallations). None of the changed files report TypeScript errors.