Skip to content

fix(mobile): get provider refs before async gaps in backup page#27597

Merged
alextran1502 merged 2 commits intoimmich-app:mainfrom
LeLunZ:bugfix-drift-backup-page
Apr 9, 2026
Merged

fix(mobile): get provider refs before async gaps in backup page#27597
alextran1502 merged 2 commits intoimmich-app:mainfrom
LeLunZ:bugfix-drift-backup-page

Conversation

@LeLunZ
Copy link
Copy Markdown
Collaborator

@LeLunZ LeLunZ commented Apr 7, 2026

Description

I actually had this in my logs now way to often, finally took the time to look into what's failing.

In the backup page we wait on the getBackupStatus/syncRemote if a user closes the page when its still loading we get this error afterwards:

Bad state: Cannot use "ref" after the widget was disposed.
#0      ConsumerStatefulElement._assertNotDisposed (package:flutter_riverpod/src/consumer.dart:550)
#1      ConsumerStatefulElement.read (package:flutter_riverpod/src/consumer.dart:619)
#2      _DriftBackupPageState.initState.<anonymous closure> (package:immich_mobile/pages/backup/drift_backup.page.dart:52)
<asynchronous suspension>

To fix the issue, I read the providers at the beginning of the function so we can still call backupNotifier.updateSyncing after the widget has been disposed.

How Has This Been Tested?

  • manual ui test

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

/

@LeLunZ
Copy link
Copy Markdown
Collaborator Author

LeLunZ commented Apr 7, 2026

@alextran1502 sorry I just noticed the issue also occurs in the startBackup function and added a commit to fix it

@alextran1502 alextran1502 merged commit b5bed02 into immich-app:main Apr 9, 2026
59 of 60 checks passed
jrasm91 pushed a commit that referenced this pull request Apr 9, 2026
* fix(mobile): get provider refs before async gaps in backup page

* fix(mobile): use previously created provider refs in start backup function
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Apr 10, 2026
…3) (#128)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [immich-app/immich](https://github.com/immich-app/immich) | patch | `v2.7.2` → `v2.7.3` |

---

### Release Notes

<details>
<summary>immich-app/immich (immich-app/immich)</summary>

### [`v2.7.3`](https://github.com/immich-app/immich/releases/tag/v2.7.3)

[Compare Source](immich-app/immich@v2.7.2...v2.7.3)

### v2.7.3

#### What's Changed

##### 🐛 Bug fixes

- fix(server): avoid false restore failures on large database imports by [@&#8203;ErasmusAndre](https://github.com/ErasmusAndre) in [#&#8203;27420](immich-app/immich#27420)
- fix(mobile): improve image load cancellation handling by [@&#8203;LeLunZ](https://github.com/LeLunZ) in [#&#8203;27624](immich-app/immich#27624)
- fix(server): people search not showing for 3 or less characters by [@&#8203;zackpollard](https://github.com/zackpollard) in [#&#8203;27629](immich-app/immich#27629)
- fix(web): don't cache empty search results for people search by [@&#8203;zackpollard](https://github.com/zackpollard) in [#&#8203;27632](immich-app/immich#27632)
- fix(mobile): get provider refs before async gaps in backup page by [@&#8203;LeLunZ](https://github.com/LeLunZ) in [#&#8203;27597](immich-app/immich#27597)
- fix: ssr open graph tags by [@&#8203;jrasm91](https://github.com/jrasm91) in [#&#8203;27639](immich-app/immich#27639)

##### 📚 Documentation

- fix(docs): updated docker deprecation link  by [@&#8203;mmomjian](https://github.com/mmomjian) in [#&#8203;27633](immich-app/immich#27633)

#### New Contributors

- [@&#8203;fluffy](https://github.com/fluffy) made their first contribution in [#&#8203;27606](immich-app/immich#27606)
- [@&#8203;ErasmusAndre](https://github.com/ErasmusAndre) made their first contribution in [#&#8203;27420](immich-app/immich#27420)

**Full Changelog**: <immich-app/immich@v2.7.2...v2.7.3>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9naXRodWItcmVsZWFzZSIsInR5cGUvcGF0Y2giXX0=-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/128
Co-authored-by: bot-owl <bot@erwanleboucher.dev>
Co-committed-by: bot-owl <bot@erwanleboucher.dev>
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.

2 participants