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

Rollback of chain should not roll back start of move promotion #79

Closed
kreibaum opened this issue Oct 13, 2022 · 4 comments
Closed

Rollback of chain should not roll back start of move promotion #79

kreibaum opened this issue Oct 13, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@kreibaum
Copy link
Owner

Yorick reported on WhatsApp

@kreibaum kreibaum added the bug Something isn't working label Oct 13, 2022
@kreibaum
Copy link
Owner Author

This is even stranger. When your turn starts and you get to promote at the start, then the button to rollback is available. It should not be available and it correctly does nothing.

After you have promoted, the button could arguably be available (It is your time after all so why not do a different decision) - But it is not available.

Now after you lift a piece, the option becomes available and fully rolls back your move including the promotion at the start.

@kreibaum
Copy link
Owner Author

I tried to fix this by pushing the "Required Action" into the current match state. And then I wanted to derive it from that.

That still doesn't allow me do differentiate between "Your turn started, Lift a piece" and "You just promoted and now get to lift". Only in the second position is a rollback allowed.

It seems like Rollback behaves like a "Legal Action" so I should try to derive it in client JavaScript instead.

@kreibaum
Copy link
Owner Author

Elm Side: LegalActionsResponse

Rust (Wasm) Side: LegalActionsDeterminedData

@kreibaum
Copy link
Owner Author

Happy with the state I have with the bf2b7ac commit. The button now uses library logic (wasm) and shows up exactly when a rollback would do something. If I change library logic in the future, the frontend will adapt :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant