Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix if a NAS share cannot be reached, iina fails to start, #4973 #4975

Closed
wants to merge 1 commit into from

Conversation

low-batt
Copy link
Contributor

@low-batt low-batt commented Jun 4, 2024

This commit will:

  • Add a new preference enableRecentDocumentsWorkaround
  • Change the AppDelegate methods restoreRecentDocuments and saveRecentDocuments to not do anything if enableRecentDocumentsWorkaround has not been set to true
  • Change restoreRecentDocuments to use the options withoutMounting and withoutUI when creating a URL from bookmark data
  • Add code to restoreRecentDocuments to create a URL from a string if creating using bookmark data fails

This has to do with the workaround added for issue #4688 where starting with Sonoma macOS erases the list of recent documents when an unsigned IINA executable is run. This affects developers as well as normal users that test nightly builds. These changes correct the problem with IINA causing macOS to prompt the user to mount volumes when the list of recent documents contains files on volumes that are not mounted.

However it is not possible to correct the long delays when the volume is mounted, but unreachable, such as a NAS that macOS does not know yet has been shutdown. For this reason this commit adds a preference that must be set using terminal and the defaults command to enable the workaround.


Description:

This commit will:
- Add a new preference enableRecentDocumentsWorkaround
- Change the AppDelegate methods restoreRecentDocuments and
  saveRecentDocuments to not do anything if
  enableRecentDocumentsWorkaround has not been set to true
- Change restoreRecentDocuments to use the options withoutMounting and
  withoutUI when creating a URL from bookmark data
- Add code to restoreRecentDocuments to create a URL from a string if
  creating using bookmark data fails

This has to do with the workaround added for issue #4688 where starting
with Sonoma macOS erases the list of recent documents when an unsigned
IINA executable is run. This affects developers as well as normal users
that test nightly builds. These changes correct the problem with IINA
causing macOS to prompt the user to mount volumes when the list of
recent documents contains files on volumes that are not mounted.

However it is not possible to correct the long delays when the volume is
mounted, but unreachable, such as a NAS that macOS does not know yet has
been shutdown. For this reason this commit adds a preference that must
be set using terminal and the defaults command to enable the workaround.
@low-batt low-batt linked an issue Jun 4, 2024 that may be closed by this pull request
@low-batt
Copy link
Contributor Author

low-batt commented Jun 4, 2024

This fixes the problem with this workaround causing macOS to prompt the user to mount a dismounted volume. However I could not find a way to stop the workaround from causing macOS to prompt the user about a volume it thinks is mounted, but can't be accessed.

As this workaround is for users who test unsigned IINA nightly builds (and anyone who builds IINA themselves), it must not disrupt users who only use signed releases. I don't see a way to accomplish that. So I have added a new preference enableRecentDocumentsWorkaround that is set to false by default. People needing this workaround will have to execute this command in Terminal:

defaults write com.colliderli.iina enableRecentDocumentsWorkaround true

Unfortunate as it is very annoying to have your list of recent documents cleared. But that is a macOS issue. I'm still troubled that I have not been able to find a discussion on the net of this new macOS Sonoma behavior. I would think developers would have noticed this.

@low-batt low-batt requested review from uiryuu and lhc70000 June 4, 2024 20:39
@lhc70000
Copy link
Member

Merged via 9978a1d.

@lhc70000 lhc70000 closed this Jun 22, 2024
@lhc70000 lhc70000 deleted the do-not-mount branch June 22, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If a NAS share cannot be reached, iina fails to start
2 participants