Repository navigation
feat(platform)!: createdAt ends in Z, and useChat knows when Base44 has a prompt or answer - #354
Merged
Merged
Conversation
…as a prompt or answer ChatItem.createdAt passed Base44's created_date through with no zone, so new Date() read it as local time, while a pending prompt's ended in Z. The hook now gives every timestamp its Z, in the pending prompt's shape. Send chat message and Submit tool-call input stay open until the turn ends, and there is no "accepted" response to resolve on. The hook now reads it from the live updates instead: Base44's copy of the prompt, the prompt in its queue (event or snapshot), or the question no longer waiting. send() and the answer actions resolve then, and a backend failure after that, such as a server timeout mid-turn, no longer sets error, drops the prompt or reopens the question. ChatBackend's docs now say to forward the request and return its result. BREAKING CHANGE: ChatItem.createdAt always ends in Z. Remove any Z you added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🚀 Package Preview Available! (
|
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.57-pr.354.eeb83f0Prefer 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.57-pr.354.eeb83f0"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.57-pr.354.eeb83f0"
}
}
Preview published to npm registry — try new features instantly! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked live on a Tiny Sunny app: a send while the AI is busy answers
200 {"queued": true} in under a second, so a queued prompt's send never
waits long enough to fail late. Also checked: refusals (404, 401) come back
in under half a second, and a caller that disconnects doesn't cancel the
turn. ChatBackend's docs now note that a Next.js server action shouldn't
wait out the turn, since server actions run one at a time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ozsay
approved these changes
Oct 26, 2026
This was referenced Oct 26, 2026
wixysam
added a commit
that referenced
this pull request
Oct 29, 2026
…xamples for sendMessage and submitToolCallInput (#356) #354 changed how a send or an answer ends, so the intros that said a failure sets `error` now say when it does. The Backend calls closing paragraph is split into the route-handler case and the server-action case, without colons. sendMessage() gets a route handler and a server action that waits a few seconds for a refusal, modeled on the starter's waitForRefusal. submitToolCallInput() gets a route handler that forwards extra_user_input, which Submit tool-call input now documents. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Answers two review questions on
@base44/platform/react0.5.0.1.
createdAtformatsChatItem.createdAtpassed Base44'screated_datethrough with no zone, sonew Date()read it as local time. A pending prompt'screatedAtended inZ. Outside UTC the two disagreed, and Base44's times showed off by the offset.toItemsnow gives every timestamp itsZ, in the pending prompt's shape (2026-10-25T11:00:00.000Z). Only ISO date-times are touched, becausenew Date()guesses at other shapes ("1Z"parses as 2001). The docs caveat is gone.Breaking: anyone who appended a
Zthemselves now gets…ZZ. Noted in the changelog.2. "Resolve once Base44 accepts the request"
Send chat message and Submit tool-call input stay open until the turn ends, and nothing answers "accepted" before that. A backend that awaited them got a rejection whenever a server timeout hit mid-turn. The hook then dropped the prompt, reopened the question and showed an error for a turn that was still running.
The hook now reads acceptance from the live updates:
send()and the answer actions resolve at that point. A backend failure after it doesn't seterror, drop the prompt or reopen the question. A refusal before it behaves as before.ChatBackend's docs now say to forward the request and return its result. They also say that a Next.js server action shouldn't wait out the turn, because server actions run one at a time.Checked live (Tiny Sunny dev workspace)
created_date2026-10-25T13:42:11.682000, no zone200 {"queued": true}in 0.4s, so a queued prompt needs no special handlingTests
tsc, type tests, eslint and all 160 unit tests pass.🤖 Generated with Claude Code