Repository navigation
fix(server): keep a deferral card on screen while other resources update - #4399
Open
OneEarJoe5 wants to merge 1 commit into
Open
OneEarJoe5 wants to merge 1 commit into
OneEarJoe5 wants to merge 1 commit into
Conversation
When a resource shows an adaptive card with a submit callback during playerConnecting, any deferrals.update() from another resource sends the combined progress text to the client, which replaces the card. Nothing shows the card again, so the player can't answer it and the resource waits forever. Hold back progress messages while a card is waiting for its response. The card resource replacing it (update, done, a new card), the player submitting it, or a rejection still go through as before. Cards without a callback don't hold anything back. Signed-off-by: OneEarJoe5 <212275319+OneEarJoe5@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
A card shown with
deferrals.presentCard(card, cb)gets replaced by the progress text as soon as any other resource callsdeferrals.update(). The card never comes back, so the player can't submit it and the resource waits on a callback that can't fire. Common on servers where several resources defer inplayerConnecting(framework, inventory, queue, name checks...).How is this PR achieving the goal
ClientDeferralnow remembers which resource has a card that's still waiting for a response. While there is one,UpdateDeferralsdoesn't send the progress message to the client. It's released when:update(),done()or presents another card,and rejections and the final resolve go through like before. Cards without a callback don't hold anything back, so status-only cards (queues etc.) behave the same as now.
Server side only, the client doesn't change.
This PR applies to the following area(s)
Server
Successfully tested on
Game builds: 3889
Platforms: Windows
Repro: one resource shows a card with an
Input.Textand a submit callback, a second resource keeps callingdeferrals.update()every second for a few seconds and thendone().Other cases I checked with the fix:
done("reason")) while the card is open: the rejection shows right awayupdate()itself after the answer: card goes away, both resources' progress lines showChecklist
Fixes issues
fixes #4397