Skip to content

refactor: cache platform SDK connections per network#24

Merged
PastaPastaPasta merged 1 commit into
mainfrom
refactor/cache-platform-sdk-connections
May 17, 2026
Merged

refactor: cache platform SDK connections per network#24
PastaPastaPasta merged 1 commit into
mainfrom
refactor/cache-platform-sdk-connections

Conversation

@PastaPastaPasta
Copy link
Copy Markdown
Member

Summary

  • connectPlatformSdk now returns a cached singleton per network instead of creating a fresh EvoSDK instance on every call, eliminating repeated connection overhead for sequential operations.
  • Added disconnectPlatformSdk(network) export so callers can force a fresh connection on error.
  • withConnectedPlatformSdk invalidates the cache on connection-level errors (transport/network failures) but keeps it alive for application-level errors (identity not found, etc.).

Test plan

  • npm run build passes (verified locally)
  • Verify sequential Platform operations (e.g. fetch identity then check balance) reuse the same connection (single "Connecting to..." log)
  • Verify connection-level failure (e.g. network offline) clears the cache and retries with a fresh instance on next call
  • Verify application-level errors (e.g. identity not found) do not disrupt the cached connection

🤖 Generated with Claude Code

connectPlatformSdk now returns a singleton per network instead of creating a fresh instance on every call. Added disconnectPlatformSdk() for callers to force a fresh connection. withConnectedPlatformSdk invalidates the cache on connection-level errors but keeps it alive for application errors.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@PastaPastaPasta has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 26 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3a0b377-7b7a-44f8-b69b-ad39ec818d35

📥 Commits

Reviewing files that changed from the base of the PR and between 26ddc07 and 3ed4312.

📒 Files selected for processing (1)
  • src/platform/client.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/cache-platform-sdk-connections

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 and usage tips.

@PastaPastaPasta PastaPastaPasta merged commit e1a28e4 into main May 17, 2026
3 checks passed
@PastaPastaPasta PastaPastaPasta deleted the refactor/cache-platform-sdk-connections branch May 17, 2026 21:43
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