[PR #7782] [MERGED] chore: bumped device_info_plus to 11.2.2 #8109

Closed
opened 2026-03-23 23:22:39 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7782
Author: @birnam
Created: 4/18/2025
Status: Merged
Merged: 4/21/2025
Merged by: @LucasXu0

Base: mainHead: dependencybump-device_info_plus


📝 Commits (3)

  • dd783ad bumped device_info_plus to 11.2.2 -- this version avoids the crash that happens when getInfo() is called on Windows in a VM or with Hyper-V active
  • 9cc8890 chore: bumped device_info_plus to 11.2.2 -- this version avoids the crash that happens when getInfo() is called on Windows in a VM or with Hyper-V active
  • b1c97b1 Merge branch 'dependencybump-device_info_plus' of github.com:birnam/AppFlowy into dependencybump-device_info_plus

📊 Changes

2 files changed (+3 additions, -3 deletions)

View changed files

📝 frontend/appflowy_flutter/pubspec.lock (+2 -2)
📝 frontend/appflowy_flutter/pubspec.yaml (+1 -1)

📄 Description

Bug Resolution

fixes https://github.com/AppFlowy-IO/AppFlowy/issues/6422
and the related issues:
https://github.com/AppFlowy-IO/AppFlowy/issues/6677
https://github.com/AppFlowy-IO/AppFlowy/issues/6979
https://github.com/AppFlowy-IO/AppFlowy/issues/5874

Bug: When running AppFlowy.exe on some Windows machines, an uncaught error stopped all app processes resulting in the window never appearing and the application processes to be stuck in 'Background processes' in Task Manager. Unlike some similar reports, this case was not caused by the window appearing offscreen or corrupted AppData files.

Cause: A system call to GetPhysicallyInstalledSystemMemory returns an unexpected 0, causing device_info_plus to throw an error when used to retrieve a deviceId. See device_info_plus issue https://github.com/fluttercommunity/plus_plugins/issues/2957 for their discussion. After doing more research into this on my own, I found the root cause.

On Windows, device_info_plus calls GetPhysicallyInstalledSystemMemory to get the amount of system memory. This function is known to fail in Windows VMs, but I found that it also fails when Microsoft Hyper-V is active on the computer. I believe Hyper-V to be the missing commonality between the multiple issues linked above. Hyper-V is enabled to meet various requirements, such as WSL, Docker Desktop, or running other hypervisors in order to pass CPU based virtualization to other VMs.

The device_info_plus fix was to return 0 when GetPhysicallyInstalledSystemMemory failed, which prevents the crash although does not actually provide the memory information. This is not an issue for AppFlowy since we only need the deviceId, although I will recommend they include a fallback call to GlobalMemoryStatusEx to actually retrieve the system memory information when the existing call fails.

For reference, this is their comment on this solution from the linked issue. The other two properties mentioned involve calls to GetComputerNameEx and GetUserName. In my tests, neither of these have shown vulnerable to the VM/Hyper-V condition, and regardless neither of these omissions affect AppFlowy.

There are three properties that will throw a WindowsException when the result is 0, which has been like that since 2022 when it was originally implemented, so I am kind of surprised no one proposed a change.

I will do a PR returning default values instead of throwing, as I don't see the benefit of throwing an error, specially if 3rd party packages are not taking care of caching possible errors.

Fix description: the device_info_plus dependency override was updated to 11.2.2, which was the first to integrate the 2957 fix. (There are newer 11.3.x releases but I found dependency clashes when trying the latest version in AppFlowy)


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Update device_info_plus dependency to version 11.2.2 to resolve Windows-specific memory retrieval issues

Bug Fixes:

  • Fixed an issue causing application crashes on Windows machines with Hyper-V enabled by updating the device_info_plus package to handle memory information retrieval errors

Chores:

  • Updated pubspec.yaml to override device_info_plus dependency to version 11.2.2

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7782 **Author:** [@birnam](https://github.com/birnam) **Created:** 4/18/2025 **Status:** ✅ Merged **Merged:** 4/21/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `dependencybump-device_info_plus` --- ### 📝 Commits (3) - [`dd783ad`](https://github.com/AppFlowy-IO/AppFlowy/commit/dd783ad459c43908cb9a3a4eae9eec51fb1f7d36) bumped device_info_plus to 11.2.2 -- this version avoids the crash that happens when getInfo() is called on Windows in a VM or with Hyper-V active - [`9cc8890`](https://github.com/AppFlowy-IO/AppFlowy/commit/9cc8890ca6cab5b8a61a9473a317bf6a833003a3) chore: bumped device_info_plus to 11.2.2 -- this version avoids the crash that happens when getInfo() is called on Windows in a VM or with Hyper-V active - [`b1c97b1`](https://github.com/AppFlowy-IO/AppFlowy/commit/b1c97b1454145013099dc947f5eb79bbd7d99a65) Merge branch 'dependencybump-device_info_plus' of github.com:birnam/AppFlowy into dependencybump-device_info_plus ### 📊 Changes **2 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/pubspec.lock` (+2 -2) 📝 `frontend/appflowy_flutter/pubspec.yaml` (+1 -1) </details> ### 📄 Description ### Bug Resolution fixes https://github.com/AppFlowy-IO/AppFlowy/issues/6422 and the related issues: https://github.com/AppFlowy-IO/AppFlowy/issues/6677 https://github.com/AppFlowy-IO/AppFlowy/issues/6979 https://github.com/AppFlowy-IO/AppFlowy/issues/5874 Bug: When running AppFlowy.exe on some Windows machines, an uncaught error stopped all app processes resulting in the window never appearing and the application processes to be stuck in 'Background processes' in Task Manager. Unlike some similar reports, this case was not caused by the window appearing offscreen or corrupted AppData files. Cause: A system call to `GetPhysicallyInstalledSystemMemory` returns an unexpected `0`, causing device_info_plus to throw an error when used to retrieve a deviceId. See device_info_plus issue https://github.com/fluttercommunity/plus_plugins/issues/2957 for their discussion. After doing more research into this on my own, I found the root cause. On Windows, device_info_plus calls `GetPhysicallyInstalledSystemMemory` to get the amount of system memory. This function is known to fail in Windows VMs, but I found that it also fails when Microsoft Hyper-V is active on the computer. I believe Hyper-V to be the missing commonality between the multiple issues linked above. Hyper-V is enabled to meet various requirements, such as WSL, Docker Desktop, or running other hypervisors in order to pass CPU based virtualization to other VMs. The device_info_plus fix was to return 0 when `GetPhysicallyInstalledSystemMemory` failed, which prevents the crash although does not actually provide the memory information. This is not an issue for AppFlowy since we only need the deviceId, although I will recommend they include a fallback call to `GlobalMemoryStatusEx` to actually retrieve the system memory information when the existing call fails. For reference, this is their comment on this solution from the linked issue. The other two properties mentioned involve calls to GetComputerNameEx and GetUserName. In my tests, neither of these have shown vulnerable to the VM/Hyper-V condition, and regardless neither of these omissions affect AppFlowy. > There are three properties that will throw a WindowsException when the result is 0, which has been like that since 2022 when it was originally implemented, so I am kind of surprised no one proposed a change. > > I will do a PR returning default values instead of throwing, as I don't see the benefit of throwing an error, specially if 3rd party packages are not taking care of caching possible errors. Fix description: the device_info_plus dependency override was updated to 11.2.2, which was the first to integrate the 2957 fix. (There are newer 11.3.x releases but I found dependency clashes when trying the latest version in AppFlowy) --- #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. ## Summary by Sourcery Update device_info_plus dependency to version 11.2.2 to resolve Windows-specific memory retrieval issues Bug Fixes: - Fixed an issue causing application crashes on Windows machines with Hyper-V enabled by updating the device_info_plus package to handle memory information retrieval errors Chores: - Updated pubspec.yaml to override device_info_plus dependency to version 11.2.2 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8109
No description provided.