Browse Source

Drop the ability refresh when no character is picked

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stan 4 ngày trước cách đây
mục cha
commit
7f2f24dba4

+ 2 - 9
Sunrise/src/server/bap/encrypted/push/queuez/queuez_banner_push.cpp

@@ -246,10 +246,7 @@ bool append_account_resync_appearance_notification(
     const state::AccountState account = state::account_snapshot();
     const std::uint64_t selected = state::account::selected_character_soid(account);
     if (selected == 0) {
-        // The appearance record belongs to the character the player picked. Before a pick there is
-        // none, and the account change that armed this resync already went out in the Family-4 frame
-        // ahead of it. Refusing would report a failure that frame covered and leave the retry lane
-        // re-running on a screen whose whole purpose is to wait for that pick.
+        // Before a pick no appearance record is owed, so nothing is appended.
         return true;
     }
     if (before.family0Character != selected) {
@@ -293,11 +290,7 @@ bool append_account_resync_roster_notification(Scratch& scratch,
     const state::AccountState account = state::account_snapshot();
     const std::uint64_t selected = state::account::selected_character_soid(account);
     if (selected == 0) {
-        // The character record and account roster this lane carries describe the picked character.
-        // Before a pick there is none to describe, and the account change that armed this resync
-        // already went out in the Family-4 frame ahead of it. Refusing would report a failure that
-        // frame covered and leave the retry lane re-running on a screen that waits for the pick
-        // which would end it.
+        // Before a pick no character record is owed, so nothing is appended.
         return true;
     }
     std::size_t characterIndex = account.characterCount;

+ 6 - 4
Sunrise/src/server/bap/encrypted/queuez/queuez_deferred_push.cpp

@@ -445,7 +445,6 @@ selected_character(const state::AccountState& account) noexcept {
     auto nextSendNonce = session.sendNonce;
     std::size_t framedSize = 0;
     queuez::SessionState current = session.queuez;
-    bool wrote = false;
     if (current.family0Active) {
         queuez::SessionState appearanceAfter{};
         if (!push::append_account_resync_appearance_notification(scratch,
@@ -458,7 +457,6 @@ selected_character(const state::AccountState& account) noexcept {
             return false;
         }
         current = appearanceAfter;
-        wrote = true;
     }
     if (current.family3Active) {
         queuez::SessionState rosterAfter{};
@@ -474,9 +472,13 @@ selected_character(const state::AccountState& account) noexcept {
             return false;
         }
         current = rosterAfter;
-        wrote = true;
     }
-    if (!wrote || framedSize == 0 || framedSize > response.size() || !queuez::valid(current)) {
+    if (framedSize == 0 && queuez::valid(current)) {
+        // Both lanes appended nothing because nothing is picked, so no refresh is owed.
+        session.characterRefreshScope = CharacterRefreshScope::none;
+        return false;
+    }
+    if (framedSize == 0 || framedSize > response.size() || !queuez::valid(current)) {
         core::log::write(core::log::Channel::server,
                          core::log::Level::warn,
                          "ev=queuez stage=ability_refresh result=fail");