Skip to content

Race condition in raid history updates after multi-client challenge ends #9

@frolv

Description

@frolv

When a user finishes a challenge, especially in a group, their client's raid history often fails to update correctly. This is caused by a fundamental difference in timing between the client's action and the server's finalization logic.

The current process is:

  1. A client finishes the challenge and sends a CHALLENGE_END_REQUEST to notify the server.
  2. The server acknowledges the single client through a CHALLENGE_END_RESPONSE but does not finalize the challenge yet. Instead, it waits for all other participants in the group to finish or for a timeout to occur.
  3. The client, having received its acknowledgment, immediately requests its raid history.
  4. This request arrives while the server is still waiting to finalize the challenge, so it is correctly reported as IN_PROGRESS.

This results in the challenge appearing stuck in progress in the user's side panel, as the UI is not refreshed again once the server eventually finalizes the challenge for the whole group.


Proposed Solution: Event-Driven History Refresh
To resolve this, the client should stop trying to guess when the challenge is finalized. Instead, the server should explicitly notify the client when the challenge's state is officially resolved.

The proposed flow is:

  1. Client Finishes: A client completes the challenge and sends its CHALLENGE_END_REQUEST.
  2. Local State Reset: The server acknowledges the request with CHALLENGE_END_RESPONSE. The client immediately updates its local UI (e.g., the status returns to idle) but does not request a history refresh at this point.
  3. Server Waits for Group: The challenge processing server marks this client as done and waits for the remaining group members to finish or for a timeout.
  4. Server Finalizes & Broadcasts: Once the challenge is finalized, the server pushes a new notification to all involved clients.
  5. Client Refreshes History: Only upon receiving this finalization event does the client request its raid history, ensuring the fetched data is now accurate and complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions