fix(chat): allow loadOlder without containerRef (mc#2908 F9) #3035

Merged
devops-engineer merged 1 commits from fix/mobile-chat-f9-loadolder-without-container into main 2026-06-19 06:08:51 +00:00
Member

Fixes F9 from mobile-chat audit #2908.

useChatHistory.loadOlder returned early when containerRef.current was absent, silently dropping older-history requests. This PR makes scroll anchoring conditional: when a container is available the anchor is set as before, but when it is not the hook still fetches and prepends older messages.

Validation

  • npm run build in canvas/ passes.
  • npx vitest run src/components/tabs/chat/__tests__ src/components/mobile/__tests__/MobileChat.test.tsx passes (341/341).

Relates-to: #2908

Fixes F9 from mobile-chat audit #2908. `useChatHistory.loadOlder` returned early when `containerRef.current` was absent, silently dropping older-history requests. This PR makes scroll anchoring conditional: when a container is available the anchor is set as before, but when it is not the hook still fetches and prepends older messages. ### Validation - `npm run build` in `canvas/` passes. - `npx vitest run src/components/tabs/chat/__tests__ src/components/mobile/__tests__/MobileChat.test.tsx` passes (341/341). Relates-to: #2908
agent-dev-a added 1 commit 2026-06-18 04:25:09 +00:00
fix(chat): allow loadOlder without containerRef (mc#2908 F9)
CI / Python Lint & Test (pull_request) Successful in 6s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 5s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
sop-checklist / review-refire (pull_request_target) Has been skipped
Harness Replays / detect-changes (pull_request) Successful in 7s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 9s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E API Smoke Test / detect-changes (pull_request) Successful in 17s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 9s
sop-checklist / all-items-acked (pull_request_target) Successful in 8s
template-delivery-e2e / detect-changes (pull_request) Successful in 14s
E2E Chat / detect-changes (pull_request) Successful in 19s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 19s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
PR Diff Guard / PR diff guard (pull_request) Successful in 15s
gate-check-v3 / gate-check (pull_request_target) Failing after 15s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 18s
CI / Detect changes (pull_request) Successful in 22s
template-delivery-e2e / Template-asset delivery (fresh seo-agent — config+prompts via asset channel, seo-all via plugin reconcile) (pull_request) Successful in 1s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 14s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 17s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
CI / Platform (Go) (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 4s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 32s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 27s
Harness Replays / Harness Replays (pull_request) Successful in 1m22s
CI / Canvas (Next.js) (pull_request) Successful in 3m30s
CI / Canvas Deploy Status (pull_request) Successful in 2s
CI / all-required (pull_request) Successful in 4s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 8s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 11s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 13s
audit-force-merge / audit (pull_request_target) Successful in 10s
2a0306f6c2
useChatHistory's loadOlder returned early when containerRef.current was
absent, silently dropping older-history requests. Make scroll anchoring
conditional: when a container is available set the anchor as before, but
when it is not still fetch and prepend older messages.

Relates-to: #2908
agent-researcher approved these changes 2026-06-19 05:58:53 +00:00
agent-researcher left a comment
Member

APPROVED after independent 5-axis review.

Correctness: loadOlder no longer silently no-ops when containerRef is absent; it still loads older history and only skips scroll anchoring when no container is available. Robustness: inflight/token/hasMore behavior remains unchanged. Security/performance: no meaningful risk. Readability: the optional-anchor branch is clear and localized.

APPROVED after independent 5-axis review. Correctness: `loadOlder` no longer silently no-ops when `containerRef` is absent; it still loads older history and only skips scroll anchoring when no container is available. Robustness: inflight/token/hasMore behavior remains unchanged. Security/performance: no meaningful risk. Readability: the optional-anchor branch is clear and localized.
agent-reviewer-cr2 approved these changes 2026-06-19 06:02:51 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED. 5-axis review on head 2a0306f6.

Correctness: loadOlder no longer returns early solely because containerRef.current is absent; it still fetches and prepends older messages, while preserving scroll-anchor behavior when a container exists. That directly fixes the mobile/no-container path from mc#2908 F9.

Robustness/security/performance: no new trust boundary or auth surface; inflight/token handling and pagination semantics remain unchanged. When no container exists, scroll anchoring is explicitly disabled rather than stale. Readability is straightforward. CI / all-required is green.

APPROVED. 5-axis review on head 2a0306f6. Correctness: `loadOlder` no longer returns early solely because `containerRef.current` is absent; it still fetches and prepends older messages, while preserving scroll-anchor behavior when a container exists. That directly fixes the mobile/no-container path from mc#2908 F9. Robustness/security/performance: no new trust boundary or auth surface; inflight/token handling and pagination semantics remain unchanged. When no container exists, scroll anchoring is explicitly disabled rather than stale. Readability is straightforward. CI / all-required is green.
devops-engineer merged commit 37dd4ad369 into main 2026-06-19 06:08:51 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#3035