Repository navigation
fix(nextcloud-talk): scope room cache to lookup credentials - #178227
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR scopes Nextcloud Talk room classifications to the server, resolved API credentials, and network policy used for each lookup. Example: Account default looks up shared-room on nc.example.com and then other.example.com, where the room types differ.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR fixes a source-confirmed cache-identity bug still present on current main, and no introduced code defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Nextcloud Talk plugin resolves room metadata before inbound authorization; account credentials and a room token enter the lookup, and a direct, group, or unknown classification selects downstream routing and access rules. flowchart TD
A[Inbound Talk message] --> B[Room lookup owner]
C[Resolved credentials and network policy] --> B
B --> D[Scoped bounded cache]
B --> E[Guarded Nextcloud HTTP request]
D --> F[DM or group access policy]
E --> F
F --> G[Agent dispatch and reply]
Technical reviewBest possible solution: Retain this focused repair in the existing room-info owner and verify its authorization effects through the production message flow. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically permits cross-context cache reuse before credential checks; the PR reports four intended baseline failures, but this review executed no target code. Is this the best way to solve the issue? The patch addresses the root cause with the smallest complete change: resolve existing credentials first and include every classification-affecting lookup context in the existing cache key. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4601114c7fbd. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +8, Tests +51. Total +59 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 3:44 AM ET / 07:44 UTC. |
|
Merged via squash.
|
What Problem This Solves
Fixes Nextcloud Talk room-kind lookups reusing a cached direct/group result from a different server or API credential context with the same account ID and room token. A cached network-policy rejection also incorrectly suppresses a lookup under a different policy.
User Impact
Room classification now follows the actual server and API identity used for the lookup. Missing credentials no longer reuse a previously authenticated result. Same-context lookups still share the existing bounded cache. No configuration, protocol, storage, dependency, or migration change.
Why This Change Was Made
The room-info owner resolves its existing credentials before cache access and includes server URL, API user, a SHA-256 password digest, and the private-network policy choice in the key, alongside account and room. The digest uses the existing public Plugin SDK helper; raw passwords are not stored in cache keys.
Inbound handling consumes this classification for direct-versus-group routing and policy. This repair does not change those policies, guarded HTTP, response decoding/release, transient-error propagation to durable ingress, TTLs, or capacity limits.
Best-effort tradeoffs accepted
None removed. This is a bounded cache-identity bug fix, not a LARGE cleanup PR. Same-context remote room-kind changes retain the existing five-minute best-effort TTL; permanent-error fallback retains its existing thirty-second TTL. No generation counters, invalidation fences, or new cache owner were introduced.
Evidence
Acceptance rule: same account/token with interleaved contexts A/B/A must return the independently supplied kinds for A and B with exactly two physical lookup calls; removing credentials must return no authoritative classification without another request. A cached policy rejection must not suppress another policy's successful lookup, while returning to the first policy reuses its own rejection.
28a0b5808ba7cd091e3013343be7dfa7968ef732, unchanged production: four added regression cases failed for the intended stale-classification/rejection reason; eight existing cases passed. Command:node scripts/run-vitest.mjs extensions/nextcloud-talk/src/room-info.test.ts --maxWorkers=1. File duration 25.86 seconds, wrapper wall 56.14 seconds on the shared loaded host.node scripts/run-vitest.mjs extensions/nextcloud-talk/src/room-info.test.ts extensions/nextcloud-talk/src/room-info.fetch-timeout.test.ts extensions/nextcloud-talk/src/inbound.room-info-retry.test.ts extensions/nextcloud-talk/src/api-credentials.test.ts test/scripts/lint-suppressions.test.ts --maxWorkers=1. Wrapper wall 548.68 seconds on the shared loaded host, dominated by compiler preparation/imports; the real HTTP timeout case took 562 ms. CI seconds pending.1b2ac83bb9cf6abe44fd52acbe70f99f9636efcd, supplying broad/type-aware proof. No whole-graph local build/typecheck or broad suite.git diff --check. Scoped cycles cover 46 production files: zero runtime cycles and no new static components against the pinned base.Production delta: 8 net lines added (+15/-7); tests add 51 lines. This is a discovered routing/cache-identity bug fix, not a LARGE cleanup or residue.
Merged through the native workflow as
e8df190f4617c9e0e5f6adff4ed2ec8aacc6d710; ancestry verified against fetched main andorigin/mainat6088df9dbf4f8e61c9f09f7e6258bf1a5884e0e5. No CI rerun, repair push, or inherited-failure exception.