Skip to content
Discussion options

You must be logged in to vote

I've added a bunch of print statements internally in drift to figure out where the delay is coming from, and it looks like this might be outside of our control.

First, I've adopted the test to first wait for the stream to emit its initial item before making the update:

import 'dart:async';

import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:test/test.dart';

import '../generated/todos.dart';

void main() {
  test('watch updates depends on a microtask delay', () async {
    final db = TodoDb(NativeDatabase.memory());
    await db.customSelect('SELECT 1').get();

    var triggered = false;
    var firstCompleted = Completer<void>();
    db.todosTable.all().

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by misha
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants