Repository navigation
feat(platform)!: getSession with the socket path from the session, and asyncapi.json from production - #313
Open
amitbardos wants to merge 3 commits into
Open
feat(platform)!: getSession with the socket path from the session, and asyncapi.json from production#313amitbardos wants to merge 3 commits into
amitbardos wants to merge 3 commits into
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.53-pr.313.0299b5aPrefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.53-pr.313.0299b5a"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.53-pr.313.0299b5a"
}
}
Preview published to npm registry — try new features instantly! |
amitbardos
force-pushed
the
amitb/platform-asyncapi-sync
branch
from
October 11, 2026 12:41
bb9a3d5 to
10d8bae
Compare
amitbardos
force-pushed
the
amitb/platform-asyncapi-sync
branch
2 times, most recently
from
October 12, 2026 14:16
43c68a6 to
ffc290a
Compare
amitbardos
force-pushed
the
amitb/platform-event-codegen
branch
from
October 12, 2026 14:19
7e08ce4 to
419e113
Compare
amitbardos
force-pushed
the
amitb/platform-asyncapi-sync
branch
from
October 12, 2026 14:19
ffc290a to
c6d7478
Compare
amitbardos
marked this pull request as ready for review
October 13, 2026 07:20
asyncapi.json is the document production serves now that base44-dev/apper#29607 has deployed, and gen:events regenerated the types: TaskProgressed.event_type is the five task values, and current/total are integers. sync-asyncapi.mjs documents production as its default source, and PlatformSnapshot's JSDoc links to app.snapshot on Socket messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ough builder.init() takes getSession, which returns the Create socket session body unchanged. The socket opens at the session's socket_url and socket_path on the first connect(), and moves when a renewed session has a different address. createPlatformClient() takes no options; socketUrl, getSessionToken and PlatformClientOptions are gone. An invalid session rejects connect() with session_unavailable. SocketSession is listed with PlatformSnapshot under the builder page's Type Definitions. Version 0.2.0, with a CHANGELOG.md written against what 0.1.0 shipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amitbardos
force-pushed
the
amitb/platform-asyncapi-sync
branch
from
October 13, 2026 12:06
95678d9 to
99cb9ca
Compare
🚀 Package Preview Available! (
|
An hourly workflow (and workflow_dispatch) compares https://app.base44.com/api/asyncapi.json with the committed copy first, so a run with nothing new stops before installing anything. When they differ it regenerates the event types, builds the docs, runs the Platform SDK tests and opens or updates one rolling PR on bot/platform-asyncapi-sync. It closes that PR when main already matches production. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amitbardos
force-pushed
the
amitb/platform-asyncapi-sync
branch
from
October 13, 2026 12:11
99cb9ca to
5bea8e5
Compare
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.
Based on
mainnow that #312 is merged.Three commits. #317 and #318 are folded in here and closed. The Socket messages page is no longer generated in this repo: mintlify-docs builds it from the AsyncAPI document production serves (base44-dev/mintlify-docs#2479), and the JSDoc links to it at
/developers/references/apps-api/sections/socket-messages.1.
asyncapi.jsonfrom production (2316986)The committed document is the one production serves now that base44-dev/apper#29607 has deployed (identical to
https://app.base44.com/api/asyncapi.json), andgen:eventsregenerated the types.TaskProgressed.event_typeis now the five task values, andcurrent/totalare integers.2.
getSessionand the socket path from the session (686327c, breaking, 0.2.0)The browser passes one function instead of
socketUrlandgetSessionToken, and the socket path comes from the session instead of the hard-coded/ws/socket.io/.builder.init({ getSession, onError }):getSession: () => Promise<SocketSession>, whereSocketSessionis{ session_token, socket_url, socket_path }. Other keys (session_id,expires_in) are ignored.getSessionis called everywheregetSessionTokenwas called before: the first connect, renewal aftersession.endedwith reasonexpired, and the single renewal after aconnection_deniedon a cached token. The 20-second timeout and the cancellation inauthenticate()are unchanged.connect(), because the address is known only after the first session. Transport reconnects keep using the cached session.socket_urlorsocket_path, the SDK doesn't call the old socket's auth callback. It removes the old socket's listeners, disconnects it, opens a socket at the new address, and rejoins every active subscription.socket_urlmust be an HTTP(S) origin with no credentials, path, query or fragment (the same check as before).socket_pathmust be an absolute path with no query or fragment, and can't start with//.createPlatformClient()takes no arguments. No options are left. TypeScript callers that still pass{ socketUrl, getSessionToken }get a compile error instead of having the values silently ignored. An optional parameter can be added later without a breaking change.PlatformClientOptionsis removed.session_unavailable, whether the token, the URL or the path is invalid.connect()rejects with it andonErrorreceives it. NoTypeErroris thrown. The code already meant that the session endpoint gave the SDK nothing usable.CHANGELOG.mdwritten against what 0.1.0 shipped (Base44PlatformClient,serverUrl), including the type renames from feat(platform): generate event types from AsyncAPI, and Mintlify docs for @base44/platform #312. JSDoc, examples,README.md, unit, type and package tests are updated.SocketSessionis listed on the builder reference page.3. Hourly AsyncAPI sync (
5bea8e5).github/workflows/sync-asyncapi.ymlruns every hour, like mintlify-docs' OpenAPI syncs, and onworkflow_dispatch. It first compares production's document with the committed one, so an hour with nothing new stops beforenpm ci. Otherwise it runssync:asyncapiandgen:events. Ifasyncapi.jsonor the generated types changed, it builds the docs, runs the Platform SDK tests and opens or updates one rolling PR onbot/platform-asyncapi-sync, rebuilt frommainon every run. When nothing changed, it closes a leftover sync PR. It uses the pinnedactions/checkoutandactions/setup-node, the Wix gateway proxy and the runner'sgh, and adds no dependencies. Production already serves a document identical to the committed one, so a run today finds no diff. After merging, trigger it once by hand.Tests
PATH=/opt/homebrew/bin:$PATH npm testinpackages/platform:npm run check:eventsreportsbuilder.events.generated.ts is up to date.npm run create-docs, run after the tests, completes.npm run lintis clean.New unit tests cover: the path taken from the session, extra keys in the body ignored, renewal at a new address moving the socket and rejoining both subscriptions, a failed renewal, a late session after
close(), and 11 invalid bodies.Needs attention
package.jsonis already at 0.2.0, somanual-publish.ymlwithversion: 0.2.0fails ("Version not changed"), and withminorit would publish 0.3.0. Either add--allow-same-versionto the workflow, or setpackage.jsonback to 0.1.0 and publish withminor.mainand breaking without a version bump. Don't publish frommainuntil this PR merges; then publish both as 0.2.0.🤖 Generated with Claude Code