Skip to content

Making copi.owasp.org more stable by adding retry logic when there are glitches. - #3020

Merged
sydseter merged 12 commits into
masterfrom
fix-user-logout
May 21, 2026
Merged

sydseter merged 12 commits into
masterfrom
fix-user-logout

Conversation

@sydseter

@sydseter sydseter commented May 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Making copi.owasp.org more stable by adding retry logic when there are glitches.
  • Also adding a see result button when the game finishes.
  • Adding error handling for 400 Bad Request.
  • Adding ULID validation and logging instead of propagating errors if there are temporary issues.
game summary

Created with ai. Here is the chat:

conversation-transcript.txt

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

@sydseter
sydseter requested a review from rewtd as a code owner May 21, 2026 19:02
Copilot AI review requested due to automatic review settings May 21, 2026 19:02
@sydseter
sydseter requested a review from cw-owasp as a code owner May 21, 2026 19:02
@sydseter sydseter added elixir Pull requests that update elixir code copi.owasp.org labels May 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve stability of the copi.owasp.org Phoenix app by adding retry logic for transient load failures (primarily in LiveViews and API flows), and updates the finished-game UI to provide a clearer “go to summary” action.

Changes:

  • Introduced configurable resilience settings (retry delay + retry limits) and applied retry/“temporary issue” handling to GameLive.Show and PlayerLive.Index/Show.
  • Improved API/health controller resilience paths and expanded test coverage with stubs for transient/not-found scenarios.
  • Updated the finished-game Player view to present a game-summary navigation button/link.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
copi.owasp.org/test/copi/release_test.exs Adds release task coverage for migrate/rollback edge cases.
copi.owasp.org/test/copi/ip_helper_test.exs Adds more socket/connect_info IP extraction cases.
copi.owasp.org/test/copi/encrypted/binary_test.exs Adds coverage for invalid encryption key failure modes.
copi.owasp.org/test/copi/cornucopia_test.exs Adds Player.find/1 not-found expectation test.
copi.owasp.org/test/copi_web/resilience_test.exs Tests CopiWeb.Resilience config/default behavior.
copi.owasp.org/test/copi_web/live/player_live/show_test.exs Adds extensive coverage for retry/transient/not-found branches via stubs.
copi.owasp.org/test/copi_web/live/player_live/index_pure_test.exs Adds direct callback tests for PlayerLive.Index edge branches.
copi.owasp.org/test/copi_web/live/player_live/form_component_test.exs Adds direct callback tests for the form component update/validate paths.
copi.owasp.org/test/copi_web/live/player_live_test.exs Expands Player LiveView tests for redirects and retry handling.
copi.owasp.org/test/copi_web/live/game_live/show_test.exs Expands Game show tests incl. retry flow + invalid round behavior.
copi.owasp.org/test/copi_web/live/game_live/show_pure_test.exs Adds pure tests for mount hook + put_uri_hook.
copi.owasp.org/test/copi_web/live/game_live/game_form_helpers_test.exs Adds tests for companion-suit helper behavior.
copi.owasp.org/test/copi_web/live/game_live/create_game_form_test.exs Adds test that validates form updates when edition changes.
copi.owasp.org/test/copi_web/live/game_live_test.exs Removes /error redirect expectations now replaced by softer handling.
copi.owasp.org/test/copi_web/copi_web_test.exs Adds basic CopiWeb macro/static_paths sanity tests.
copi.owasp.org/test/copi_web/controllers/health_controller_test.exs Adds resilience tests for repo failures via stub module.
copi.owasp.org/test/copi_web/controllers/api_controller_test.exs Adds tests for transient/not-found/update-failure API branches via stubs.
copi.owasp.org/lib/copi/cornucopia/player.ex Adds warning logging when player lookup returns nil.
copi.owasp.org/lib/copi/cornucopia/game.ex Adds warning logging when game lookup returns nil.
copi.owasp.org/lib/copi/cornucopia/dealt_card.ex Adds warning logging when dealt-card lookup returns nil.
copi.owasp.org/lib/copi_web/resilience.ex Introduces centralized resilience configuration accessors + defaults.
copi.owasp.org/lib/copi_web/live/player_live/show.html.heex Updates finished-game UI navigation to game summary.
copi.owasp.org/lib/copi_web/live/player_live/show.ex Adds retry logic, dependency-injection hooks for testing, and better error handling.
copi.owasp.org/lib/copi_web/live/player_live/index.ex Adds retry logic for transient game load failures and module injection for tests.
copi.owasp.org/lib/copi_web/live/game_live/show.ex Adds retry logic for transient game load failures; soft-handles invalid round.
copi.owasp.org/lib/copi_web/controllers/health_controller.ex Allows injectable repo module and catches failures for readiness checks.
copi.owasp.org/lib/copi_web/controllers/api_controller.ex Adds transient/second-read handling and injectable game/repo modules for tests.
copi.owasp.org/config/test.exs Configures resilience settings for faster test retries.
copi.owasp.org/config/prod.exs Configures resilience settings for production.
copi.owasp.org/config/dev.exs Configures resilience settings for development.
copi.owasp.org/config/config.exs Adds baseline resilience config defaults.

Comment thread copi.owasp.org/config/prod.exs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 8 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.

@sydseter
sydseter merged commit 1811480 into master May 21, 2026
16 checks passed
@sydseter
sydseter deleted the fix-user-logout branch May 21, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copi.owasp.org elixir Pull requests that update elixir code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants