Skip to content

feat: Console SDK update for version 13.1.0#94

Merged
ArnabChatterjee20k merged 3 commits into
mainfrom
dev
May 29, 2026
Merged

feat: Console SDK update for version 13.1.0#94
ArnabChatterjee20k merged 3 commits into
mainfrom
dev

Conversation

@premtsd-code

@premtsd-code premtsd-code commented May 20, 2026

Copy link
Copy Markdown
Contributor

This PR contains updates to the Console SDK for version 13.1.0.

@greptile-apps

greptile-apps Bot commented May 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Console SDK to version 13.0.1, adding three new services (Presences, Advisor, Usage), presence support over WebSocket in Realtime, and a significant restructuring of the Project model (auth methods, services, and protocols collapsed into typed arrays).

  • New services: Presences (REST CRUD + usage), Advisor (reports/insights), and Usage (raw event/gauge queries) are added and exported from src/index.ts.
  • Realtime presence: upsertPresence() introduced with a single-flight socket-creation lock, appConnected guard to prevent premature sends, and automatic re-delivery on reconnect \u2014 but close() in subscribe() tears down the socket without checking pendingPresence, which can silently stop presence delivery when the last subscription is closed.
  • Breaking model changes: Project loses ~40 fields in favor of authMethods, services, and protocols arrays; several enums renamed with a Project prefix; BackupList types corrected from Index[]/Collection[] to BackupPolicy[]/BackupArchive[].

Confidence Score: 4/5

Safe to merge with the caveat that the socket-lifetime bug in Realtime can silently drop presence delivery after the last subscription is closed.

The new Presences, Advisor, and Usage services follow established patterns and look correct. The Realtime changes are well-structured, but close() in subscribe() checks only activeSubscriptions.size === 0 when deciding whether to shut down the socket, bypassing the pendingPresence guard that createSocketLocked correctly enforces. A user who subscribes to a channel, calls upsertPresence, then closes that last subscription will have their socket torn down and reconnect silenced. The rest of the changes are clean.

src/services/realtime.ts — specifically the close() closure inside subscribe() around line 608

Important Files Changed

Filename Overview
src/services/realtime.ts Added presence upsert over WebSocket with single-flight socket creation and appConnected guard; close() ignores pendingPresence when deciding whether to tear down the socket
src/models.ts Large restructure: Project model fields collapsed into authMethods/services/protocols arrays; BackupList fixed to use correct BackupPolicy/BackupArchive types; new Presence, Insight, Report, UsageEvent/Gauge, UsagePresence types added; BillingLimits fields made optional
src/services/presences.ts New service for managing presence records via REST following the standard dual-overload pattern
src/services/advisor.ts New service exposing listReports, getReport, deleteReport, listInsights, getInsight endpoints
src/services/usage.ts New service with listEvents and listGauges for querying raw usage metrics
src/index.ts Exports updated: Presences, Advisor, Usage services added; old enum names replaced with new project-prefixed equivalents
.github/workflows/publish.yml Actions pinned to full commit SHAs for supply-chain security; Node.js version set to 24.14.1

Comments Outside Diff (1)

  1. src/services/realtime.ts, line 608-614 (link)

    P1 close() ignores pendingPresence, breaking the socket-lifetime invariant

    createSocketLocked() keeps the socket open whenever pendingPresence is set (even with zero subscriptions), but close() only checks activeSubscriptions.size === 0 before setting reconnect = false and tearing down the socket. So if a user holds an active presence and then calls close() on their last subscription, the socket is destroyed and reconnect is silenced — presence delivery stops silently until the user calls upsertPresence() again.

    The condition should mirror createSocketLocked: this.activeSubscriptions.size === 0 && !this.pendingPresence.

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

Comment on lines +95 to +96
UsageRead = 'usage.read',
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing newline at end of file — can cause noisy diffs and lint failures.

Suggested change
UsageRead = 'usage.read',
}
UsageRead = 'usage.read',
}

Comment thread src/enums/project-o-auth-provider-id.ts Outdated
Comment on lines +46 to +47
GoogleImagine = 'googleImagine',
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing newline at end of file — same as the other new enum files.

Suggested change
GoogleImagine = 'googleImagine',
}
GoogleImagine = 'googleImagine',
}

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Console SDK update for version 13.0.1 feat: Console SDK update for version 13.0.0 May 29, 2026
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Console SDK update for version 13.0.0 feat: Console SDK update for version 13.1.0 May 29, 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.

3 participants