Skip to content

feat: Console SDK update for version 11.0.0#85

Open
premtsd-code wants to merge 2 commits intomainfrom
dev
Open

feat: Console SDK update for version 11.0.0#85
premtsd-code wants to merge 2 commits intomainfrom
dev

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

@premtsd-code premtsd-code commented Apr 16, 2026

This PR contains updates to the SDK for version 11.0.0.

What's Changed

  • Breaking: Renamed project.updateProtocolStatus to project.updateProtocol (endpoint changed to /project/protocols/{protocolId})
  • Breaking: Renamed project.updateServiceStatus to project.updateService (endpoint changed to /project/services/{serviceId})
  • Breaking: Removed SMS template methods getSmsTemplate, getSMSTemplate, updateSmsTemplate, updateSMSTemplate, deleteSmsTemplate, and deleteSMSTemplate from Projects service
  • Breaking: Removed SmsTemplate model and SmsTemplateType/SmsTemplateLocale enums
  • Breaking: Moved email template type and locale from the URL path to the request body — endpoints are now /projects/{projectId}/templates/email
  • Breaking: Made locale optional on projects.getEmailTemplate, projects.updateEmailTemplate, and projects.deleteEmailTemplate
  • Breaking: Reordered positional parameters on projects.updateEmailTemplatelocale now optional and placed after message (object-style callers unaffected)
  • Breaking: Removed deprecated Deno121, Deno124, and Deno135 values from Runtime, Runtimes, and BuildRuntime enums
  • Breaking: Removed shared queries set from the Realtime client — queries are now tracked per-subscription
  • Added DetectionFrameworkType and DetectionRuntimeType enums
  • Added type field to ProviderRepositoryFrameworkList, ProviderRepositoryRuntimeList, DetectionFramework, and DetectionRuntime models
  • Added Realtime subscribe message protocol — channels and queries are sent per-subscription over the WebSocket, with per-subscription IDs and reconnect handling
  • Updated updateProtocol and updateService descriptions to "Update properties of a specific…"

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

This PR upgrades the Console SDK to 11.0.0 with a comprehensive set of breaking changes: SMS template methods and models removed, email template endpoints moved from path params to body params, deprecated Deno runtimes dropped, two service methods renamed, and new detection enums added. The most significant change — and the one needing the most scrutiny — is the Realtime refactor, which moves channels/queries from the WebSocket URL to per-subscription subscribe messages sent after the connection opens.

  • P1 – pendingSubscribeSlots race condition (src/client.ts and src/services/realtime.ts): sendSubscribeMessage overwrites pendingSubscribeSlots on every call. If a subscription change triggers a second send while a response is in flight, the index table is stale and subscription IDs will be mapped to wrong slots.
  • P1 – Stale subscription-ID maps on reconnect (src/client.ts and src/services/realtime.ts): The connected handler no longer clears slotToSubscriptionId/subscriptionIdToSlot before processing new mappings, allowing stale entries to accumulate across reconnects. The accompanying slot-shift heuristic (targetSlot = slot + 1 fallback) is undocumented and can silently produce incorrect mappings.

Confidence Score: 3/5

Not safe to merge without resolving the Realtime subscription-ID mapping race condition and stale-map issues, which can cause events to be silently delivered to the wrong callback or missed entirely.

Two independent P1 defects exist in the Realtime layer (both in client.ts and realtime.ts): the pendingSubscribeSlots overwrite race and the missing map-clear on reconnect. These directly affect correctness of real-time event routing in production. All other changes (email template refactor, SMS removal, enum additions, service renames) are straightforward and well-implemented.

src/client.ts and src/services/realtime.ts — the Realtime subscribe-message protocol implementation

Important Files Changed

Filename Overview
src/client.ts Major Realtime refactor: channels/queries moved from URL to per-subscription WebSocket messages; pendingSubscribeSlots race condition and fragile slot-shift heuristic in the connected handler introduce P1 correctness issues
src/services/realtime.ts Parallel Realtime service refactor with the same pendingSubscribeSlots overwrite race and missing map-clear on reconnect; RealtimeRequest.data widened to any
src/services/projects.ts Email template endpoints moved from path params to body params; locale made optional; SMS template methods cleanly removed; changes look correct
src/services/project.ts Renamed updateProtocolStatusupdateProtocol and updateServiceStatusupdateService with updated API paths; straightforward rename with no issues
src/models.ts Added type field to ProviderRepositoryFrameworkList, ProviderRepositoryRuntimeList, DetectionFramework, and DetectionRuntime; removed SmsTemplate model; looks correct
src/index.ts Exports updated: SmsTemplateType/SmsTemplateLocale removed, DetectionFrameworkType/DetectionRuntimeType added
CHANGELOG.md 11.0.0 section added with a comprehensive list of breaking changes and new features

Comments Outside Diff (1)

  1. src/client.ts, line 343-376 (link)

    P1 pendingSubscribeSlots overwritten before response arrives

    sendSubscribeMessage resets pendingSubscribeSlots every time it is called. If a new subscription (or unsubscription) triggers a second call while the first response message is still in flight, the index table will be stale when the first response arrives and the subscription-ID-to-slot mapping will be wrong for both messages.

    Concrete scenario: slots [0] are in flight → user subscribes again → sendSubscribeMessage is called with slots [0, 1] → pendingSubscribeSlots = [0, 1] → first response (1 entry) arrives → pendingSubscribeSlots[0] is 0, OK by accident → second response (2 entries) arrives → correct. However if the first response arrives after the second send and has 1 entry, its index maps against the new [0, 1] table and correctly resolves slot 0, but any later response for the second send will try to resolve 2 entries against the same overwritten table.

    A sequence number or queue of pending slot arrays would make this deterministic.

Reviews (2): Last reviewed commit: "chore: update Console SDK to 11.0.0" | Re-trigger Greptile

Comment thread CHANGELOG.md
Comment thread README.md Outdated
@ChiragAgg5k ChiragAgg5k changed the title feat: Console SDK update for version 10.0.0 feat: Console SDK update for version 11.0.0 Apr 22, 2026
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.

2 participants