@@ -372,6 +372,8 @@ void main() {
372
372
});
373
373
374
374
syncTest ('increase ttl' , (controller) {
375
+ const startTime = 1740826800 ;
376
+
375
377
control (
376
378
'subscriptions' ,
377
379
json.encode ({
@@ -383,7 +385,7 @@ void main() {
383
385
);
384
386
385
387
var [row] = db.select ('SELECT * FROM ps_stream_subscriptions' );
386
- expect (row, containsPair ('expires_at' , 1740826800 ));
388
+ expect (row, containsPair ('expires_at' , startTime ));
387
389
388
390
controller.elapse (const Duration (minutes: 30 ));
389
391
@@ -399,15 +401,22 @@ void main() {
399
401
400
402
// Which should increase its expiry date.
401
403
[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 ));
403
413
404
- // Stopping should not increase the expiry date. Client SDKs will do that
405
- // periodically.
414
+ // Stopping should not increase the expiry date.
406
415
controller.elapse (const Duration (minutes: 30 ));
407
416
control ('stop' , null );
408
417
409
418
[row] = db.select ('SELECT * FROM ps_stream_subscriptions' );
410
- expect (row, containsPair ('expires_at' , 1740828600 ));
419
+ expect (row, containsPair ('expires_at' , startTime + 3600 ));
411
420
});
412
421
413
422
syncTest ('can be made implicit' , (_) {
0 commit comments