fix(session): use finite archived timestamp schema (#25275)
This commit is contained in:
@@ -142,9 +142,9 @@ const Share = Schema.Struct({
|
|||||||
url: Schema.String,
|
url: Schema.String,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Legacy HTTP accepted any number here, and persisted data may already contain
|
// Legacy HTTP accepted negative values here. Keep archive timestamps permissive
|
||||||
// negative values. Keep archive timestamps permissive while other clocks stay non-negative.
|
// while excluding non-finite values that cannot round-trip through JSON.
|
||||||
export const ArchivedTimestamp = Schema.Number
|
export const ArchivedTimestamp = Schema.Finite
|
||||||
|
|
||||||
const Time = Schema.Struct({
|
const Time = Schema.Struct({
|
||||||
created: NonNegativeInt,
|
created: NonNegativeInt,
|
||||||
|
|||||||
@@ -258,6 +258,18 @@ describe("HttpApi server", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("matches SDK-affecting request schema details", () => {
|
||||||
|
const effect = effectOpenApi()
|
||||||
|
const sessionUpdate = effect.paths["/session/{sessionID}"]?.patch?.requestBody
|
||||||
|
const sessionUpdateSchema =
|
||||||
|
typeof sessionUpdate === "object" && sessionUpdate && "content" in sessionUpdate
|
||||||
|
? sessionUpdate.content?.["application/json"]?.schema
|
||||||
|
: undefined
|
||||||
|
const sessionUpdateProperties = sessionUpdateSchema?.properties as Record<string, OpenApiSchema> | undefined
|
||||||
|
const time = sessionUpdateProperties?.time
|
||||||
|
expect(time?.properties?.archived).toEqual({ type: "number" })
|
||||||
|
})
|
||||||
|
|
||||||
test("documents event routes as server-sent events", () => {
|
test("documents event routes as server-sent events", () => {
|
||||||
const effect = effectOpenApi()
|
const effect = effectOpenApi()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user