Post

Replies

Boosts

Views

Activity

Couple simple suggestions to make WKExtendedRuntimeSession a lot better
I just launched my watch app with alarms using WKExtendedRuntimeSession, as an api I wish it was possible to: set a small title/message on the alarm ui itself, right now all it displays is the "Alarm from < app name >" with the app icon, but it would be nice to be able to set a short 1~2 line message below it as well! be able to read the current scheduled date, right now it's only possible to know it's scheduled.
2
0
57
5d
SwiftData 100% crash when fetching history with codable (test included!)
SwiftData crashes 100% when fetching history of a model that contains an optional codable property that's updated: SwiftData/Schema.swift:389: Fatal error: Failed to materialize a keypath for someCodableID.someID from CrashModel. It is possible that this path traverses a type that does not work with append(), please file a bug report with a test. Would really appreciate some help or even a workaround. Code: import Foundation import SwiftData import Testing struct VaultsSwiftDataKnownIssuesTests { @Test func testCodableCrashInHistoryFetch() async throws { let container = try ModelContainer( for: CrashModel.self, configurations: .init( isStoredInMemoryOnly: true ) ) let context = ModelContext(container) try SimpleHistoryChecker.hasLocalHistoryChanges(context: context) // 1: insert a new value and save let model = CrashModel() model.someCodableID = SomeCodableID(someID: "testid1") context.insert(model) try context.save() // 2: check history it's fine. try SimpleHistoryChecker.hasLocalHistoryChanges(context: context) // 3: update the inserted value before then save model.someCodableID = SomeCodableID(someID: "testid2") try context.save() // The next check will always crash on fetchHistory with this error: /* SwiftData/Schema.swift:389: Fatal error: Failed to materialize a keypath for someCodableID.someID from CrashModel. It is possible that this path traverses a type that does not work with append(), please file a bug report with a test. */ try SimpleHistoryChecker.hasLocalHistoryChanges(context: context) } } @Model final class CrashModel { // optional codable crashes. var someCodableID: SomeCodableID? // these actually work: //var someCodableID: SomeCodableID //var someCodableID: [SomeCodableID] init() {} } public struct SomeCodableID: Codable { public let someID: String } final class SimpleHistoryChecker { static func hasLocalHistoryChanges(context: ModelContext) throws { let descriptor = HistoryDescriptor<DefaultHistoryTransaction>() let history = try context.fetchHistory(descriptor) guard let last = history.last else { return } print(last) } }
0
0
55
May ’25
SwiftData crashes on fetchHistory
Hi, would it be possible that instead of crashing when calling fetchHistory that function simply throws an error instead? fetchHistory seems to crash when it cannot understand the models if they are not compatible etc… which is understandable, but it makes it really difficult to handle and debug, there's not a lot of details, and honestly I would just rather that it throws an error and let me ignore a history entry that might be useless rather than crashing the entire app. Thank you!
1
1
44
Apr ’25
Shortcuts doesn't honor Always Allow with custom AppEntity!
My app has an AppIntent that returns a collection of AppEntity items. Using a shortcut with the repeat with each action to loop the entities, it prompts me multiple times to allow to share the entities (I select "Always Allow" on the first one, but it keeps asking over and over). All the prompts after the first one, shows an incorrect note saying something like: "Previously this shortcut was allowed to share 1 item with …" the count of items shared is always wrong, for example, if I initially selected "Always Allow" for 10 entities on the first prompt, the second says previously 1 item, the third prompt actually has the count right, saying 10 items, and then a fourth prompt (seems to be the last one) says something like 40 items Some more facts: This issue does not happen for example when I fetch entities from a system based intent, like get calendar events. It correctly only prompt for my permission once My app is already on the app store
0
0
638
Feb ’24