# Use deep copies and autosave flush before exit · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/77d23f4bf0a8f63c6dee077507de987a990c028d)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: 77d23f4bf0a8f63c6dee077507de987a990c028d

Requested commit: 77d23f4bf0a8f63c6dee077507de987a990c028d

Commit: 77d23f4bf0a8f63c6dee077507de987a990c028d

Tree: f9ea8b12f0adc6763e374d1f9d7e24b4636543ee

Author: Dara Adedeji

Committer: Dara Adedeji

## Message

```
Use deep copies and autosave flush before exit

Add LineUp.deepCopy and use deep copies when importing, snapshotting, restoring, and copying lineUps to avoid shared mutable state. Update StrategyPage.copyWith and StrategyProvider to deep-copy lineUps when constructing strategies. Introduce a _hasLoadedStrategy helper and flushPendingAutosaveBeforeExit in StrategyProvider to attempt a silent autosave (respecting autosave settings) before exit; wire this into unsaved_strategy_guard so it will try to save silently and report failures before showing the dialog. Add comprehensive tests (test/unsaved_strategy_guard_test.dart) to cover autosave-enabled/disabled, no-loaded-strategy, and error cases.

```

## Parents

- [83b610965c0751b0a03b378b802ae1c284e442ee](https://git.cafe/dara/icarus/commit/83b610965c0751b0a03b378b802ae1c284e442ee?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/77d23f4bf0a8f63c6dee077507de987a990c028d?format=markdown)
