fix demo issues

This commit is contained in:
Urtzi Alfaro
2026-01-01 19:56:07 +01:00
parent 93c9475239
commit 9aee368580
3 changed files with 14 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ class DemoSessionStatus(enum.Enum):
PARTIAL = "partial" # Some services failed, others succeeded
ACTIVE = "active" # User is actively using the session (deprecated, use READY)
EXPIRED = "expired" # Session TTL exceeded
DESTROYING = "destroying" # Session in the process of being destroyed
DESTROYED = "destroyed" # Session terminated
@@ -71,6 +72,9 @@ class DemoSession(Base):
# Session metadata
session_metadata = Column(JSONB, default=dict)
# Error tracking
error_details = Column(JSONB, default=list) # List of error objects for failed sessions
def __repr__(self):
return f"<DemoSession(session_id={self.session_id}, status={self.status.value})>"

View File

@@ -59,7 +59,7 @@ def upgrade() -> None:
sa.Column('base_demo_tenant_id', sa.UUID(), nullable=False),
sa.Column('virtual_tenant_id', sa.UUID(), nullable=False),
sa.Column('demo_account_type', sa.String(length=50), nullable=False),
sa.Column('status', sa.Enum('pending', 'ready', 'failed', 'partial', 'active', 'expired', 'destroyed', name='demosessionstatus'), nullable=True),
sa.Column('status', sa.Enum('pending', 'ready', 'failed', 'partial', 'active', 'expired', 'destroying', 'destroyed', name='demosessionstatus'), nullable=True),
sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
sa.Column('expires_at', sa.DateTime(timezone=True), nullable=False),
sa.Column('last_activity_at', sa.DateTime(timezone=True), nullable=True),
@@ -72,6 +72,7 @@ def upgrade() -> None:
sa.Column('data_cloned', sa.Boolean(), nullable=True),
sa.Column('redis_populated', sa.Boolean(), nullable=True),
sa.Column('session_metadata', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.Column('error_details', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_demo_sessions_base_demo_tenant_id'), 'demo_sessions', ['base_demo_tenant_id'], unique=False)