mirror of
https://github.com/lichess-org/mobile.git
synced 2026-05-26 13:50:52 +00:00
26df922c5efc4dd63c40724cc8f88b4202cdfd76
Previous fix was in #2859, but this PR fixes the root cause instead of adding a workaround. The root cause of this problem was that we check `_game.serverAnalysis == null` to check if the RetroController needs to trigger server analysis in case it isn't already running. When the server analysis was already triggered by the `AnalysisController`, the problem was that `archivedGameProvider` is not invalidated and still returns `null` for the server analysis field. By using the `GameRepository` directly instead, we get a fresh response from the server which correctly has a non-null `serverAnalysis`. An alternative fix would be to add `red.invalidate(archivedGameProvider(gameId))` when a server analysis request is triggered in the analysis screen, however this leads to the analysis screen being rebuilt when triggering server analysis, which causes a short flicker of the screen during the reload. To verify that everything still works, I successfully tested the following scenarios: 1) Trigger server analysis in analysis screen and immediately open "Learn From Your Mistakes" -> The loading bar correctly displays server analysis progress, once analysis is finished Learn from your mistakes is available. 2) Trigger server analysis in analysis screen, wait for it to finish and only then open "Learn From Your Mistakes" -> Learn from your mistakes is available immediately without any loading bar. 3) Trigger server analysis, wait for it to finish and then close the analysis screen. Open analysis again for the same game and open "Learn from your Mistakes". -> Learn from your mistakes is available immediately without any loading bar.
Lichess Mobile
Second iteration of the Lichess mobile app.
How to contribute
Contributions to this project are welcome!
If you want to contribute, please read the contributing guide.
If you are new to this project, you can read the documentation to get started. The CLAUDE.md is also a good resource to understand the codebase.
Setup
tl;dr: Install Flutter, clone the repo, run in order:
flutter pub getdart run build_runner watchflutter analyze --watch,
and you're ready to code!
See the dev environment docs for detailed instructions.
Running the app
To run the app, you can use the following command:
# if not already done, run the code generation
dart run build_runner build
# run the app on all available devices
flutter run -d all
Running tests
To run the tests, you can use the following command:
# if not already done, run the code generation
dart run build_runner build
flutter test
Internationalisation
Do not edit the app_en.arb file by hand, this file is generated.
For more information, see Internationalisation.
Releasing
Only for members of lichess team.
- Bump the pubspec.yaml version number. This can be in a PR making a change or a separate PR. Use semantic versioning to determine which part to increment. The version number after the + should also be incremented. For example 0.3.3+000303 with a patch should become 0.3.4+000304.
- Run workflow Deploy to Play Store
- Publish on F-Droid
Languages
Dart
99.2%
Swift
0.5%