Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1858 Switzerland] Avoid modifying 1858's train definitions #11411

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

ollybh
Copy link
Collaborator

@ollybh ollybh commented Dec 21, 2024

Implementation Notes

Issue #11372 was caused by modifying 1858's train definitions without a making a deep copy. If a game of 1858 is loaded on the server after a game of 1858 Switzerland then it is was seeing the version of the definitions after these modifications, causing errors as 1858 does not have a method for handling the blue_privates_available event.

Making a deep copy of the train definitions prevents this error.

This commit also makes a deep copy of the phase definitions. No problems have been observed with this, but making the copy is safer.

Fixes #11372.

Before clicking "Create"

  • Branch is derived from the latest master
  • Add the pins or archive_alpha_games label if this change will break existing games
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

tobymao#11372 was caused by modifying 1858's train definitions without a
making a deep copy. If a game of 1858 is loaded on the server after a
game of 1858 Switzerland then it is was seeing the version of the definitions
after these modifications, causing errors as 1858 does not have a method
for handling the `blue_privates_available` event.

Making a deep copy of the train definitions prevents this error.

This commit also makes a deep copy of the phase definitions. No problems
have been observed with this, but making the copy is safer.

Fixes tobymao#11372.
@ollybh ollybh merged commit a236c28 into tobymao:master Dec 22, 2024
1 check passed
@ollybh ollybh deleted the 1858-issue-11372 branch December 22, 2024 10:38
@ianwilson156
Copy link

Hurrah! You found the cause of the problem - well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1858] Random refresh with error message about blue privates
2 participants