You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some users are reporting crashes when an object is created in background thread. The object is defined like this:
final class RItemField: EmbeddedObject {
@Persisted var key: String
@Persisted var baseKey: String?
@Persisted var value: String
@Persisted var changed: Bool
}
And part of the code that crashes is:
override func addFields(for annotation: PDFDocumentAnnotation, to item: RItem, database: Realm) {
super.addFields(for: annotation, to: item, database: database)
for field in FieldKeys.Item.Annotation.extraPDFFields(for: annotation.type) {
let rField = RItemField()
rField.key = field.key
rField.baseKey = field.baseKey
rField.changed = true
switch field.key {
case FieldKeys.Item.Annotation.Position.pageIndex where field.baseKey == FieldKeys.Item.Annotation.position:
rField.value = "\(annotation.page)"
case FieldKeys.Item.Annotation.Position.lineWidth where field.baseKey == FieldKeys.Item.Annotation.position:
rField.value = annotation.lineWidth.flatMap({ "\(Decimal($0).rounded(to: 3))" }) ?? ""
case FieldKeys.Item.Annotation.pageLabel:
rField.value = annotation.pageLabel
case FieldKeys.Item.Annotation.Position.rotation where field.baseKey == FieldKeys.Item.Annotation.position:
rField.value = "\(annotation.rotation ?? 0)"
case FieldKeys.Item.Annotation.Position.fontSize where field.baseKey == FieldKeys.Item.Annotation.position:
rField.value = "\(annotation.fontSize ?? 0)"
default:
DDLogWarn("CreatePDFAnnotationsDbRequest: unknown field, assigning empty value - \(field.key)")
rField.value = ""
}
item.fields.append(rField)
}
}
As you can see the RItemField.value is defined as String and the value is always assigned as some string, so I don't know how I can fix this so that it doesn't become null afterwards. Any ideas?
How frequently does the bug occur?
Sometimes
Description
Some users are reporting crashes when an object is created in background thread. The object is defined like this:
And part of the code that crashes is:
As you can see the
RItemField.value
is defined asString
and the value is always assigned as some string, so I don't know how I can fix this so that it doesn't become null afterwards. Any ideas?Stacktrace & log output
Can you reproduce the bug?
No
Reproduction Steps
No response
Version
10.54.4
What Atlas Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
iOS 18.1.1
Build environment
Xcode version: 16.3
Dependency manager and version: SPM
The text was updated successfully, but these errors were encountered: