explore further integartion of effect-atom#1618
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
apps/web/src/wsTransport.ts
Outdated
|
|
||
| private scheduleReconnect() { | ||
| if (this.disposed || this.reconnectTimer !== null) { | ||
| dispose() { |
There was a problem hiding this comment.
🟢 Low src/wsTransport.ts:122
dispose() fires Scope.close via Effect.runPromise (the global runtime) and immediately calls this.runtime.dispose() without awaiting the scope closure. Since this.clientScope was created using this.runtime, disposing the runtime while the scope is still finalizing can cause incomplete resource cleanup or runtime errors if the scope's finalization depends on runtime resources. Consider chaining the two operations so the runtime disposal awaits the scope closure.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/wsTransport.ts around line 122:
`dispose()` fires `Scope.close` via `Effect.runPromise` (the global runtime) and immediately calls `this.runtime.dispose()` without awaiting the scope closure. Since `this.clientScope` was created using `this.runtime`, disposing the runtime while the scope is still finalizing can cause incomplete resource cleanup or runtime errors if the scope's finalization depends on runtime resources. Consider chaining the two operations so the runtime disposal awaits the scope closure.
Evidence trail:
apps/web/src/wsTransport.ts lines 122-130 (dispose method), lines 33-38 (constructor showing clientScope created with this.runtime)
- Remove trailing commas from `apps/web/tsconfig.json` - Keep TypeScript config consistent with project formatting rules
054d0a4 to
f8b6e5b
Compare
What Changed
Why
UI Changes
Checklist
Note
Replace React Query with Effect atom-backed state for server config, git, and WebSocket RPC
WsRpcClientandWsTransportlayer that wraps all WebSocket communication as typed Effect RPCs and streams, replacing directwsNativeApipush-channel listeners withuseServerWelcomeSubscription/useServerConfigUpdatedSubscriptionhooks.@effect/atom-react-backed atoms for server config, git status, branches, mutations (checkout, create branch, worktree, pull, init, PR), and settings; components acrossChatView,Sidebar,BranchToolbarBranchSelector,GitActionsControl,DiffPanel, andPullRequestThreadDialogare migrated from React Query to these atoms.rpc.tscontract inpackages/contractswith typedWS_METHODSconstants and RPC schemas, replacing the oldws.tspush-channel exports.ServerLifecycleEventsandServerRuntimeStartupservices on the server, startup command gating, attachment-serving HTTP routes, and platform-conditional Bun/Node layers.GitCommandError,ServerSettingsError,KeybindingsConfigError, etc.) from local modules into@t3tools/contractsand re-exports them.onServerWelcome,onServerConfigUpdated, andonServerProvidersUpdatedare removed from the publicNativeApi;git.onActionProgresssubscription is also removed.📊 Macroscope summarized 054d0a4. 44 files reviewed, 7 issues evaluated, 1 issue filtered, 3 comments posted
🗂️ Filtered Issues
apps/server/src/serverRuntimeStartup.ts — 0 comments posted, 1 evaluated, 1 filtered
return yield* readinessStateattempts to yield aServerRuntimeStartupErrorinstance directly, butyield*in Effect generators expects anEffect, not a plain error object. This will cause a runtime error. The correct code should bereturn yield* Effect.fail(readinessState)to properly fail the effect with the error. [ Failed validation ]