@@ -372,6 +372,8 @@ void main() {
372372 });
373373
374374 syncTest ('increase ttl' , (controller) {
375+ const startTime = 1740826800 ;
376+
375377 control (
376378 'subscriptions' ,
377379 json.encode ({
@@ -383,7 +385,7 @@ void main() {
383385 );
384386
385387 var [row] = db.select ('SELECT * FROM ps_stream_subscriptions' );
386- expect (row, containsPair ('expires_at' , 1740826800 ));
388+ expect (row, containsPair ('expires_at' , startTime ));
387389
388390 controller.elapse (const Duration (minutes: 30 ));
389391
@@ -399,15 +401,22 @@ void main() {
399401
400402 // Which should increase its expiry date.
401403 [row] = db.select ('SELECT * FROM ps_stream_subscriptions' );
402- expect (row, containsPair ('expires_at' , 1740828600 ));
404+ expect (row, containsPair ('expires_at' , startTime + 1800 ));
405+
406+ // The sync client uses token_expires_in lines to extend the expiry date
407+ // of active stream subscriptions.
408+ controller.elapse (const Duration (minutes: 30 ));
409+ control ('line_text' , json.encode ({'token_expires_in' : 3600 }));
410+
411+ [row] = db.select ('SELECT * FROM ps_stream_subscriptions' );
412+ expect (row, containsPair ('expires_at' , startTime + 3600 ));
403413
404- // Stopping should not increase the expiry date. Client SDKs will do that
405- // periodically.
414+ // Stopping should not increase the expiry date.
406415 controller.elapse (const Duration (minutes: 30 ));
407416 control ('stop' , null );
408417
409418 [row] = db.select ('SELECT * FROM ps_stream_subscriptions' );
410- expect (row, containsPair ('expires_at' , 1740828600 ));
419+ expect (row, containsPair ('expires_at' , startTime + 3600 ));
411420 });
412421
413422 syncTest ('can be made implicit' , (_) {
0 commit comments