Commit 5bdfffa
authored
fix: infinite dialogs with network mount failure (#1956)
Selecting a broken network mount triggers an infinite loop of dialogs
that requires killing the app:
1. Click invalid network mount
2. Try to mount network path
3. Show failure dialog
4. Trigger `NetworkDriveOpenEntityAfterMount`
* BUG: This fires even if the mount failed or the user canceled the
dialog!
6. Goto 2
Fix by having `network_drive(...)` return a Boolean indicating whether
the mount actually happened and using that to break the infinite error
loop.
Fixes #1629
Sample broken network path that triggers the infinite dialog when
selected:
**~/.config/cosmic/com.system76.CosmicFiles/v1/favorites**
```ron
[
Home,
Documents,
Downloads,
Network(
uri: "sftp://myserver/shared",
name: "",
path: "/tmp/fake-network/sftp-host=myserver/mnt",
),
]
```
- [x] I have disclosed use of any AI generated code in my commit
messages.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.3 files changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2678 | 2678 | | |
2679 | 2679 | | |
2680 | 2680 | | |
2681 | | - | |
2682 | | - | |
2683 | | - | |
2684 | | - | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
2685 | 2689 | | |
2686 | 2690 | | |
2687 | 2691 | | |
| |||
3586 | 3590 | | |
3587 | 3591 | | |
3588 | 3592 | | |
3589 | | - | |
| 3593 | + | |
3590 | 3594 | | |
3591 | 3595 | | |
3592 | 3596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
662 | | - | |
| 662 | + | |
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
672 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
673 | 678 | | |
| 679 | + | |
674 | 680 | | |
675 | 681 | | |
676 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
0 commit comments