fix(session): hide pending admission sequence
This commit is contained in:
parent
9554f9a16e
commit
2a85c861e0
17 changed files with 32 additions and 48 deletions
|
|
@ -53,7 +53,6 @@ export class LifecycleConflict extends Schema.TaggedErrorClass<LifecycleConflict
|
|||
|
||||
const fromRow = (row: typeof SessionPendingTable.$inferSelect): Info => {
|
||||
const base = {
|
||||
admittedSeq: row.admitted_seq,
|
||||
id: SessionMessage.ID.make(row.id),
|
||||
sessionID: SessionSchema.ID.make(row.session_id),
|
||||
timeCreated: DateTime.makeUnsafe(row.time_created),
|
||||
|
|
@ -134,7 +133,6 @@ const promotedFromHistory = Effect.fn("SessionPending.promotedFromHistory")(func
|
|||
const decoded = decodeAdmittedEvent(row.data)
|
||||
if (decoded._tag !== "Some" || decoded.value.inputID !== id) continue
|
||||
const base = {
|
||||
admittedSeq: row.seq,
|
||||
id,
|
||||
sessionID,
|
||||
timeCreated: DateTime.makeUnsafe(row.created),
|
||||
|
|
@ -172,10 +170,7 @@ export const admit = Effect.fn("SessionPending.admit")(function* (
|
|||
})
|
||||
.pipe(
|
||||
Effect.flatMap((event) => {
|
||||
if (event.durable === undefined)
|
||||
return Effect.die(new Error("Session input admission event is missing aggregate sequence"))
|
||||
const base = {
|
||||
admittedSeq: event.durable.seq,
|
||||
id: request.id,
|
||||
sessionID: request.sessionID,
|
||||
timeCreated: event.created,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ describe("fromPromise", () => {
|
|||
seen = value
|
||||
return Effect.succeed(
|
||||
SessionPending.Synthetic.make({
|
||||
admittedSeq: 1,
|
||||
id: SessionMessage.ID.make(input.id),
|
||||
sessionID: Session.ID.make(input.sessionID),
|
||||
timeCreated: DateTime.makeUnsafe(0),
|
||||
|
|
|
|||
|
|
@ -484,7 +484,6 @@ describe("Session.create", () => {
|
|||
type: "user",
|
||||
data: { text: "Replay lifecycle" },
|
||||
delivery: "steer",
|
||||
admittedSeq: 1,
|
||||
})
|
||||
expect(yield* store.context(created.id)).toEqual([])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue