Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 11:00 UTC
fix(core): keep `ConnectionRequest.status` live and restore its telemetry (#4678)
This PR: - closes https://github.com/ComposioHQ/composio/issues/4663 - replaces the `{ ...state }` snapshot in `createConnectionRequest()` with a single mutable request object, so `request.status` and `toJSON()` read the same value - records the first retrieved status before the terminal check, so an immediate `FAILED`/`EXPIRED`/`REVOKED` is reflected instead of `INITIATED` - keeps `id`/`status`/`redirectUrl` as plain assignable fields; getter-only accessors (the approach in the issue's linked branch) would throw a `TypeError` on assignment in ESM strict mode despite the writable `ConnectionRequest` type - matches the Python SDK, where `wait_for_connection()` already updates `self.status` on every retrieve, so no Python change is needed - restores telemetry for `ConnectionRequest.waitForConnection()`, which stopped when #1678 turned the `ConnectionRequest` class into a factory: `telemetry.instrument()` only scanned the prototype, and a plain object's methods are own properties. It now reads own properties for plain objects; class instances are unchanged - fixes the stale `@returns` JSDoc on `createConnectionRequest()` - adds regression tests for the immediate-`ACTIVE`, polling and `REVOKED` paths plus field assignability (4 fail on `next` without the fix), and for instrumenting plain objects (fails without the `Telemetry.ts` change)