Jelajahi Sumber

Restore the roster Sense echo on every rebuild

Every roster answer echoes the squad Sense again. A client that rebuilt a
group gets its baseline back even when the group revision did not move.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stan 4 hari lalu
induk
melakukan
5bae2ccf3a

+ 1 - 32
Sunrise/src/server/bap/encrypted/push/activity/activity_roster_snapshot.cpp

@@ -597,29 +597,9 @@ build_roster_snapshot(Session& session,
     if (pendingStateLocal && pendingGroupPosition >= snapshot.roster.groupCount) {
         return refuse_override("pending_group_position");
     }
-    // Echoed Sense becomes the client's acknowledged baseline and counter. Only a rebuilt group has
-    // lost that baseline. Echoing into a live group rewinds it to the host's last merged report,
-    // which lags reports still in flight: the client then replays old counters and omits changed
-    // fields, so a respawned carrier's population is never reported.
-    const auto rebuilt = [&session, &snapshot](std::uint32_t key) {
-        for (std::size_t index = 0; index < snapshot.roster.groupCount; ++index) {
-            const message::Group& group = snapshot.roster.groups[index];
-            if (group.key != key) {
-                continue;
-            }
-            for (const RosterGroupLease& groupLease : session.activityRosterGroupLeases) {
-                if (groupLease.used && groupLease.key == key) {
-                    return !groupLease.published
-                           || groupLease.publishedSequence != group.stateSequence;
-                }
-            }
-            return true;
-        }
-        return false;
-    };
     std::size_t senseCount = 0;
     for (const message::AuthOverride& auth : snapshot.authOverrides) {
-        if (auth.slotType != 1 || !rebuilt(auth.key)) {
+        if (auth.slotType != 1) {
             continue;
         }
         server::activity::host::SenseObservationKey key{};
@@ -685,17 +665,6 @@ build_roster_snapshot(Session& session,
         ++senseCount;
     }
     snapshot.senseOverrides = std::span(scratch.rosterSenseOverrides).first(senseCount);
-    // A discarded body restores the prior leases, so these marks commit only with the frame.
-    for (std::size_t index = 0; index < snapshot.roster.groupCount; ++index) {
-        const message::Group& group = snapshot.roster.groups[index];
-        for (RosterGroupLease& groupLease : session.activityRosterGroupLeases) {
-            if (groupLease.used && groupLease.key == group.key) {
-                groupLease.publishedSequence = group.stateSequence;
-                groupLease.published = true;
-                break;
-            }
-        }
-    }
     return RosterOutcome::published;
 }
 

+ 0 - 3
Sunrise/src/server/bap/internal.h

@@ -114,9 +114,6 @@ struct RosterGroupLease {
     /** Bubbles this key was ever registered under; a later push keeps it in every one of them. */
     std::uint64_t bubbles{};
     std::uint8_t sequence{};
-    /** Group revision the client last received. A new revision rebuilds the group and its Sense. */
-    std::uint8_t publishedSequence{};
-    bool published{};
     bool used{};
 };