Skip to content

Automatically activate joined contest #471

Description

@magnified103

Motivation

The service allows a user to have multiple ContestParticipation records, but only one participation can be active at any time, determined by profile.current_contest.

When a user userX joins two contests (contestA then contestB), the following occurs:

  1. Create ContestParticipation(contestA, userX)partA
  2. Set userX.current_contest = partA
  3. Create ContestParticipation(contestB, userX)partB
  4. Set userX.current_contest = partB

To submit code for a contest problem, userX.current_contest must reference the participation associated with that contest.

As a result, after joining contestB, userX can no longer submit solutions to contestA unless they explicitly “join” contestA again, which only serves to reset:

  • userX.current_contest = partA

This behavior is unintuitive and creates unnecessary user friction.

Proposed Solution (Temporary)

As a temporary mitigation, when a user accesses a contest page, the service should:

  • Look up an existing ContestParticipation for the (user, contest) pair.
  • If found, automatically set userX.current_contest to that participation.

This removes the need for users to manually re-join a contest solely to submit solutions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions