fix(auth): members learn of ended sessions in the background
The full reading's L5: every change or reset of a password told the members inside the request, up to 500 notices one after another with a timeout of 10 seconds each, so a member out of reach held the change up for minutes. Now announceSessionsEnded tells the members of this account's notices alone, in the background on a session of its own; those not confirmed wait for the hourly run as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
5eb74639b6
commit
76291e6ab4
1 changed files with 74 additions and 8 deletions
|
|
@ -7,6 +7,8 @@ import 'package:halkyon_base_server/src/register/deletion_notices.dart';
|
|||
import 'package:halkyon_base_server/src/register/instance_api.dart';
|
||||
import 'package:halkyon_base_server/src/register/register_protocol.dart';
|
||||
import 'package:halkyon_base_server/src/register/remote_register.dart';
|
||||
import 'package:halkyon_base_server/src/register/sessions_ended.dart'
|
||||
show sessionNoticesDelivered;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
import 'package:serverpod/serverpod.dart';
|
||||
|
|
@ -677,6 +679,7 @@ void main() {
|
|||
(account: annaOnTodo, endedBefore: now),
|
||||
);
|
||||
// Every member is told to end the account's sessions too.
|
||||
await sessionNoticesDelivered();
|
||||
expect(members.sessionsTold.single, (_todo, annaOnTodo, now, null));
|
||||
|
||||
final forReset = await remote.beginPasswordSignIn(
|
||||
|
|
@ -809,6 +812,7 @@ void main() {
|
|||
password: device.newPassword(),
|
||||
keepSession: annasPhone,
|
||||
);
|
||||
await sessionNoticesDelivered();
|
||||
expect(members.sessionsTold.single, (
|
||||
_todo,
|
||||
annaOnTodo,
|
||||
|
|
|
|||
Loading…
Reference in a new issue