Align interactive handler types and Tasks client#324
Draft
kin0992 wants to merge 4 commits into
Draft
Conversation
Make interactive handlers async and add a TasksClient to centralize API calls so server-only logic remains server-side and the UI can await operations consistently. This changes handler signatures (onTaskComplete now returns Promise<void>); update any call sites to the async signature.
|
Validate required environment variables on the server to fail fast with clear errors and to prevent leaking runtime secrets into client bundles. Run pnpm install to add zod if needed and ensure .env.local is created from .env.local.example; verify the validation module is only imported on the server.
Validate required environment variables on the server using Zod to avoid leaking secrets and to fail fast when configuration is missing. Run pnpm install to add zod and ensure .env.local contains the required vars; keep this module server-only to avoid client-side imports.
Errors are now logged and surfaced via component state instead of being rethrown. This prevents uncaught exceptions and lets the UI present consistent error states. Follow-up: audit other clients for the same pattern and add tests to assert error handling is reflected in state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make interactive handlers async and add a TasksClient to centralize API calls so server-only logic remains server-side and the UI can await operations consistently. This changes handler signatures (onTaskComplete now returns Promise); update any call sites to the async signature.