Restructure step 1: lasting identity, presence and protocol 16
ci / core (push) Successful in 28s
ci / server (push) Successful in 1m5s
ci / updater-windows (push) Successful in 5m48s

Server and core: version ranges on both sides with a coded refusal; a
client id maps to the same member and token for the server's life; a
drop is `gone` for a 10-minute grace keeping ready, presence, queue
items, relay and avatar; `bye` leaves at once; ordered takeover (seq,
replaced/stale); presence joining/in/away/gone with one PresencePolicy;
joiners never pause playback and hold a held gate at most ~15 s;
state.hold; feed ids, seq and replay; the relay lives through its
source's grace and continues on re-dial; queue `by` lasting, auto
items and cancel; MediaRef carried; client ids never logged.

App: persisted client id and seq; Connection with unstable/lost/
replaced states, backoff with jitter, no lost/back pair per flap; a drop
keeps the session (state, player, media, relay source); presence in the
strip and members card; sit out = away intent; feed matched by id;
auto sit-out (idle when not playing, minimised for a while; never when
alone) replaces auto-unready; bye on close and Leave, not on update
restart; relay source re-dials through its grace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-15 21:39:47 +03:00
1 parent 51c1c5ab78
commit 9f2586b7ff
85 files changed
+5198 -1902

No files matched your search

+11 -5
View File
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sync_relay_core/core.dart';
import 'package:starsync/src/screens/home/profile.dart';
import 'package:starsync/src/session/identity.dart';
import 'package:starsync/src/shell/app_shell.dart';
import 'package:starsync/src/shell/avatar.dart';
import 'package:starsync/src/shell/motion.dart';
@@ -38,8 +38,14 @@ class _FakeVideoState extends State<FakeVideo> {
Widget build(BuildContext context) => const ColoredBox(color: Colors.black);
}
MemberView member(String id, String name, {bool ready = false, bool stale = false}) =>
MemberView(id: id, name: name, ready: ready, inSet: ready, buffered: 30, stale: stale);
MemberView member(String id, String name, {bool ready = false, bool gone = false}) =>
MemberView(
id: id,
name: name,
ready: ready,
inSet: ready,
buffered: 30,
presence: gone ? Presence.gone : Presence.watching);
void main() {
final session = SessionState.instance;
@@ -93,7 +99,7 @@ void main() {
member('b', 'Bob'),
member('c', 'Cleo', ready: true),
member('d', 'Dan'),
member('e', 'Eve', stale: true),
member('e', 'Eve', gone: true),
member('f', 'Finn'),
];
@@ -145,7 +151,7 @@ void main() {
expect(find.byKey(const ValueKey('strip-join')), findsNothing);
expect(find.byKey(const ValueKey('strip-leave')), findsOneWidget);
expect(find.byKey(const ValueKey('strip-chat')), findsOneWidget);
expect(find.text('ready 2/6'), findsOneWidget);
expect(find.text('ready 2/5'), findsOneWidget, reason: 'Eve is gone: not counted');
final stack = find.byKey(const ValueKey('party-avatars'));
// Five shown, the sixth as "+1"; ready ones first.
expect(find.descendant(of: stack, matching: find.byType(StatusAvatar)), findsNWidgets(5));