Skip to content

SSR RPC cache: use the dotted method form so bridge reads reach hivemind - #75

Merged
feruzm merged 1 commit into
mainfrom
fix/ssr-rpc-bridge-dotted-method
Aug 21, 2026
Merged

SSR RPC cache: use the dotted method form so bridge reads reach hivemind#75
feruzm merged 1 commit into
mainfrom
fix/ssr-rpc-bridge-dotted-method

Conversation

@feruzm

@feruzm feruzm commented Aug 21, 2026

Copy link
Copy Markdown
Member

Staging showed the SSR RPC cache failing every bridge.* read with Could not find API bridge while condenser_api.* reads were hitting. The cache used HiveRpcClient.Call, whose legacy {"method":"call","params":[api, method, params]} envelope hived resolves only for its own APIs; hivemind's bridge is routed by the dotted method name, which is the form the web SDK already sends.

  • HiveRpcClient.CallMethod(qualifiedMethod, params) sends "method":"bridge.get_post" (works for condenser_api too); Call keeps the legacy envelope for existing callers; both share one Send loop.
  • SsrRpc.Fill uses CallMethod for every read.
  • The test stub now emulates hived's refusal of the legacy form for bridge; the new test asserts the dotted form for a bridge and a condenser_api read and that the legacy call is refused.

Same change as 683b100, which landed on the #74 branch after that PR had merged.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@feruzm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5dd4ad37-fc0a-4924-82d2-61d0452cdeeb

📥 Commits

Reviewing files that changed from the base of the PR and between 3e26960 and adda158.

📒 Files selected for processing (3)
  • dotnet/EcencyApi.Tests/SsrRpcTests.cs
  • dotnet/EcencyApi/Handlers/SsrRpc.cs
  • dotnet/EcencyApi/Infrastructure/HiveRpcClient.cs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix SSR RPC cache bridge reads by using dotted JSON-RPC method names

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Route SSR RPC reads via dotted JSON-RPC methods so bridge.* reaches hivemind.
• Add HiveRpcClient.CallMethod() while keeping legacy Call() for existing callers.
• Extend RPC stub + tests to enforce hived/bridge routing semantics.
Diagram

graph TD
  A[SsrRpc] --> B[HiveRpcClient] --> C[Send loop] --> D{{RPC node}}
  D --> E[Hived APIs]
  D --> F[Hivemind bridge]
  A --> G[(SSR cache)]
  subgraph Legend
    direction LR
    _svc[Service/Module] ~~~ _cache[(Cache)] ~~~ _ext{{External}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Auto-switch inside Call(api, method, ...)
  • ➕ Callers keep using the same API without needing a new method.
  • ➕ Centralizes routing quirks in one place.
  • ➖ Adds implicit behavior that may surprise existing users of Call().
  • ➖ Harder to reason about exact on-the-wire format during debugging.
2. Make dotted-method the default and keep Call() as a thin wrapper
  • ➕ Converges on the modern JSON-RPC shape everywhere.
  • ➕ Reduces risk of new call sites accidentally using the legacy envelope.
  • ➖ Potentially larger blast radius if any upstream expects the legacy envelope.
  • ➖ May require broader regression testing across all RPC consumers.

Recommendation: The PR’s approach (add an explicit CallMethod() and switch SSR reads to it while retaining legacy Call()) is the best tradeoff: it fixes bridge/hivemind routing immediately, limits behavioral changes to the SSR path, and preserves compatibility for existing Call() users. The added test coverage that models hived’s refusal of legacy bridge calls meaningfully reduces regression risk.

Files changed (3) +73 / -8

Bug fix (2) +36 / -5
SsrRpc.csUse dotted RPC method form for SSR cache fills +6/-4

Use dotted RPC method form for SSR cache fills

• Updates SSR cache fill logic to call upstream via 'Client.CallMethod("api.method", ...)' instead of the legacy 'Call(api, method, ...)'. This ensures 'bridge.*' reads are routed to hivemind while retaining param cloning for JSON node ownership constraints.

dotnet/EcencyApi/Handlers/SsrRpc.cs

HiveRpcClient.csAdd CallMethod() and centralize request sending +30/-1

Add CallMethod() and centralize request sending

• Introduces 'CallMethod(qualifiedMethod, params)' to send modern JSON-RPC requests using dotted method names, required for hivemind bridge reads and compatible with condenser_api. Keeps the legacy 'Call(api, method, ...)' envelope for backward compatibility, and factors both paths through a shared 'Send()' implementation.

dotnet/EcencyApi/Infrastructure/HiveRpcClient.cs

Tests (1) +37 / -3
SsrRpcTests.csModel hived bridge routing + assert dotted method usage +37/-3

Model hived bridge routing + assert dotted method usage

• Enhances the RPC test stub to differentiate legacy 'call' envelope vs dotted 'api.method' requests, and to simulate hived refusing legacy bridge reads. Adds a new test asserting SSR reads use 'bridge.get_post' and 'condenser_api.get_dynamic_global_properties', and that legacy bridge calls throw.

dotnet/EcencyApi.Tests/SsrRpcTests.cs

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

SSR RPC cache: use dotted JSON-RPC methods so bridge reads reach hivemind

🐞 Bug fix 🧪 Tests ✨ Enhancement 🕐 40+ Minutes

Grey Divider

AI Description

• Route SSR RPC cache reads via dotted JSON-RPC methods (e.g., bridge.get_post).
• Add HiveRpcClient.CallMethod while retaining legacy Call envelope for compatibility.
• Extend stub + tests to enforce hived/hivemind routing semantics for bridge calls.
Diagram

graph TD
  A["SSR RPC cache"] --> B["SsrRpc.Fill"] --> C["HiveRpcClient.CallMethod"] --> D{{"JSON-RPC endpoint"}} --> E["hivemind (bridge)"]
  D --> F["hived (condenser_api)"]
  G["SsrRpcTests stub"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Migrate all callers to dotted methods and deprecate Call
  • ➕ Single request shape across the codebase
  • ➕ Reduces chance of future bridge-like routing bugs
  • ➖ Potentially larger change surface if other callers rely on legacy envelope behavior
  • ➖ May require coordinated rollout across multiple components
2. Special-case only bridge calls inside Call(api, method, ...)
  • ➕ No API expansion (no new public method)
  • ➕ Minimizes call-site changes
  • ➖ Hides routing semantics behind implicit branching
  • ➖ Harder to reason about which request shape is used where
3. Fix routing upstream (register bridge in legacy dispatcher)
  • ➕ No client-side behavior change
  • ➕ Keeps legacy call envelope universally usable
  • ➖ Requires operational/config changes outside this repo
  • ➖ May not be feasible depending on hived/hivemind/Jussi/HAF deployment constraints

Recommendation: Current approach is the best tradeoff: it preserves compatibility via Call(), introduces an explicit CallMethod() for the modern dotted form, and switches the SSR read path to the correct routing semantics (bridge -> hivemind) with targeted tests preventing regressions.

Files changed (3) +73 / -8

Enhancement (1) +30 / -1
HiveRpcClient.csAdd CallMethod (dotted JSON-RPC) and centralize request sending +30/-1

Add CallMethod (dotted JSON-RPC) and centralize request sending

• Introduces CallMethod(qualifiedMethod, params) to send modern JSON-RPC requests where method is a dotted name (e.g., bridge.get_post). Refactors common request execution into a shared Send() path while retaining Call(api, method, params) for legacy envelope compatibility.

dotnet/EcencyApi/Infrastructure/HiveRpcClient.cs

Bug fix (1) +6 / -4
SsrRpc.csSwitch SSR cache fill reads to HiveRpcClient.CallMethod +6/-4

Switch SSR cache fill reads to HiveRpcClient.CallMethod

• Updates the SSR RPC cache miss/fill path to call upstream via dotted method names (api.method) instead of the legacy call envelope. Keeps the existing deep-clone behavior for params to avoid JsonNode re-parenting issues.

dotnet/EcencyApi/Handlers/SsrRpc.cs

Tests (1) +37 / -3
SsrRpcTests.csEmulate legacy bridge refusal and assert dotted-method reads +37/-3

Emulate legacy bridge refusal and assert dotted-method reads

• Enhances the RPC test stub to distinguish legacy "call" envelopes vs dotted methods and to return an RPC error when bridge is invoked via the legacy envelope. Adds a new test asserting that SSR reads use dotted methods for both bridge and condenser_api, and that legacy bridge calls fail.

dotnet/EcencyApi.Tests/SsrRpcTests.cs

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display preferences with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

1 similar comment
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display preferences with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@feruzm
feruzm merged commit 76c120b into main Aug 21, 2026
4 checks passed
@feruzm
feruzm deleted the fix/ssr-rpc-bridge-dotted-method branch August 21, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant