mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 20:23:25 +01:00
Fixes “Check for Updates” not updating any sources if one source fails
This commit is contained in:
@@ -1516,40 +1516,46 @@ private extension MyAppsViewController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let (_, context) = try await result
|
do
|
||||||
|
{
|
||||||
try await context.performAsync {
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
try context.save()
|
let (_, context) = try await result
|
||||||
|
|
||||||
|
try await context.performAsync {
|
||||||
|
try context.save()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch let error as AppManager.FetchSourcesError
|
catch let error as AppManager.FetchSourcesError
|
||||||
{
|
{
|
||||||
try error.managedObjectContext?.save()
|
try await error.managedObjectContext?.performAsync {
|
||||||
throw error
|
try error.managedObjectContext?.save()
|
||||||
}
|
|
||||||
catch let mergeError as MergeError
|
|
||||||
{
|
|
||||||
guard let sourceID = mergeError.sourceID else { throw mergeError }
|
|
||||||
|
|
||||||
let sanitizedError = (mergeError as NSError).sanitizedForSerialization()
|
|
||||||
DatabaseManager.shared.persistentContainer.performBackgroundTask { context in
|
|
||||||
do
|
|
||||||
{
|
|
||||||
guard let source = Source.first(satisfying: NSPredicate(format: "%K == %@", #keyPath(Source.identifier), sourceID), in: context) else { return }
|
|
||||||
|
|
||||||
source.error = sanitizedError
|
|
||||||
try context.save()
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
print("[ALTLog] Failed to assign error \(sanitizedError.localizedErrorCode) to source \(sourceID).", error)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw mergeError
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch let mergeError as MergeError
|
||||||
|
{
|
||||||
|
guard let sourceID = mergeError.sourceID else { throw mergeError }
|
||||||
|
|
||||||
|
let sanitizedError = (mergeError as NSError).sanitizedForSerialization()
|
||||||
|
DatabaseManager.shared.persistentContainer.performBackgroundTask { context in
|
||||||
|
do
|
||||||
|
{
|
||||||
|
guard let source = Source.first(satisfying: NSPredicate(format: "%K == %@", #keyPath(Source.identifier), sourceID), in: context) else { return }
|
||||||
|
|
||||||
|
source.error = sanitizedError
|
||||||
|
try context.save()
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
print("[ALTLog] Failed to assign error \(sanitizedError.localizedErrorCode) to source \(sourceID).", error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw mergeError
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch let error as NSError
|
catch let error as NSError
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user