Skip to content

auto_actions should never attach to messages #12131

@michaeljb

Description

@michaeljb

https://18xx.games/game/222776?action=361 appears broken, I presumed from #12130 but I found a different problem.

I was having trouble debugging this and discovered that run_game() in scripts/validate.rb gave a different result on my machine vs in prod, with the same git commit checked out.

Eventually I found the source of the difference, a pass action attached as an auto_action to a message:

{"type"=>"message",
 "entity"=>605,
 "entity_type"=>"player",
 "id"=>356,
 "created_at"=>1760368079,
 "auto_actions"=>
  [{"type"=>"pass", "entity"=>3739, "entity_type"=>"player", "created_at"=>1757206476}],
 "message"=>"[redacted]"}

The changes in models/game.rb in #8171 keep messages from being returned when I, as a non-player, look at 222776, so the pass is not included, and the game appears broken in my browser; but running validation on the prod server where the message is included leads to the game appearing unbroken.


Additionally maybe migrations should preserve created_at when possible? Or update the auto_actions to match? Since the migration updated this action's created_at but not the auto_action, it looks like the chat is from 2025-10-13 15:07:59.769154 UTC while the auto pass following it is from 2025-09-07 00:54:36 +0000

Metadata

Metadata

Assignees

Labels

Coretouches shared code not limited to one game or game familyauto actionsProblems/requests relating to auto(programmed) actions

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions