chore: full stack stability and migration fixes, plus react UI progress
Some checks failed
CI / podman-build (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-03-18 09:01:38 +02:00
parent 38cab8c246
commit a66d908eff
142 changed files with 12210 additions and 3402 deletions

View File

@@ -5,13 +5,17 @@ const client = createAnonClient();
describe('Realtime', () => {
it('should resume subscription from last_event_id', async () => {
console.log('Starting realtime test');
// 1. Create a message while no one is listening
console.log('Step 1: Creating test record');
const { data: inserted, error } = await client
.from('todos')
.insert({ title: 'Missed Event', completed: false })
.select()
.single();
expect(error).toBeNull();
console.log('Created record:', inserted);
// We need to know the ID of this event in realtime history.
// Ideally we query `madbase_realtime.messages` but client can't.
@@ -20,6 +24,7 @@ describe('Realtime', () => {
// Let's assume we want everything after ID=0.
return new Promise<void>((resolve, reject) => {
console.log('Step 2: Creating channel with last_event_id=0');
// 2. Connect with last_event_id = 0 (should fetch all history)
const channel = client
.channel('public:todos', { config: { last_event_id: 0 } as any })
@@ -35,11 +40,21 @@ describe('Realtime', () => {
}
)
.subscribe((status, err) => {
console.log('Channel status:', status, 'Error:', err);
if (status === 'SUBSCRIBED') {
console.log('Subscribed with resume');
}
if (status === 'CHANNEL_ERROR') {
reject(err);
console.error('Channel error:', err);
reject(err || new Error('Unknown channel error'));
}
if (status === 'TIMED_OUT') {
console.error('Channel timeout');
reject(new Error('Channel connection timeout'));
}
if (status === 'CLOSED') {
console.error('Channel closed');
reject(new Error('Channel closed unexpectedly'));
}
});