xxfast / KStore

A tiny Kotlin multiplatform library that assists in saving and restoring objects to and from disk using kotlinx.coroutines, kotlinx.serialisation and kotlinx.io
https://xxfast.github.io/KStore/
Apache License 2.0
484 stars 15 forks source link

iOS targets crashes when store is setting a value while there is no previous file #21

Closed xxfast closed 1 year ago

xxfast commented 1 year ago
Uncaught Kotlin exception: okio.IOException: Operation not permitted
    at 0   PSCore                              0x10548be63        kfun:okio#errnoToIOException(kotlin.Int){}okio.IOException + 419 
    at 1   PSCore                              0x105490993        kfun:okio.PosixFileSystem#sink(okio.Path;kotlin.Boolean){}okio.Sink + 751 
    at 2   PSCore                              0x105565b1f        kfun:au.com.gridstone.pscore.app.data.$<get-appDataModule>$lambda$11$lambda$2$lambda$0$FUNCTION_REFERENCE$18.$<bridge-UNNN>invoke(au.com.gridstone.pscore.login.data.models.DeviceCredentials?){}#internal + 871 
    at 3   PSCore                              0x105562caf        kfun:au.com.gridstone.pscore.app.data.$<get-appDataModule>$lambda$11$lambda$2$suspendConversion0COROUTINE$2.invokeSuspend#internal + 347 
    at 4   PSCore                              0x105562e3f        kfun:au.com.gridstone.pscore.app.data.$<get-appDataModule>$lambda$11$lambda$2$suspendConversion0COROUTINE$2.invoke#internal + 195 
    at 5   PSCore                              0x1054a59e3        kfun:io.github.xxfast.kstore.KStore.$writeCOROUTINE$73.invokeSuspend#internal + 427 
    at 6   PSCore                              0x1054a5bf3        kfun:io.github.xxfast.kstore.KStore.write#internal + 183 
    at 7   PSCore                              0x1054a6493        kfun:io.github.xxfast.kstore.KStore.$setCOROUTINE$75#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 547 
    at 8   PSCore                              0x1054a6757        kfun:io.github.xxfast.kstore.KStore#set(1:0?){} + 183 
    at 9   PSCore                              0x1055180b7        kfun:au.com.gridstone.pscore.login.screens.$LoginDomain$lambda$14$lambda$13$lambda$12COROUTINE$39.invokeSuspend#internal + 8635 
    at 10  PSCore                              0x1051d4397        kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 203 
    at 11  PSCore                              0x1052d926f        kfun:kotlinx.coroutines.DispatchedTask#run(){} + 1439 
    at 12  PSCore                              0x1052ec4ab        kfun:kotlinx.coroutines.DarwinMainDispatcher.$dispatch$lambda$0$FUNCTION_REFERENCE$487.$<bridge-UNN>invoke(){}#internal + 227 
    at 13  PSCore                              0x1056b5f63        ___6f72672e6a6574627261696e732e6b6f746c696e783a6b6f746c696e782d636f726f7574696e65732d636f72652f6f70742f6275696c644167656e742f776f726b2f343465633665383530643563363366302f6b6f746c696e782d636f726f7574696e65732d636f72652f6e617469766544617277696e2f7372632f44697370617463686572732e6b74_knbridge459_block_invoke + 439 
    at 14  libdispatch.dylib                   0x1047c05a7        _dispatch_call_block_and_release + 31 
    at 15  libdispatch.dylib                   0x1047c205b        _dispatch_client_callout + 19 
    at 16  libdispatch.dylib                   0x1047d280f        _dispatch_main_queue_drain + 1195 
    at 17  libdispatch.dylib                   0x1047d2353        _dispatch_main_queue_callback_4CF + 43 
    at 18  CoreFoundation                      0x1c0c166f7        <redacted> + 15 
    at 19  CoreFoundation                      0x1c0bf8057        <redacted> + 2035 
    at 20  CoreFoundation                      0x1c0bfced3        CFRunLoopRunSpecific + 611 
    at 21  GraphicsServices                    0x1f9efe367        GSEventRunModal + 163 
    at 22  UIKitCore                           0x1c30db3cf        <redacted> + 887 
    at 23  UIKitCore                           0x1c30db033        UIApplicationMain + 339 
    at 24  SwiftUI                             0x1c46e8013        <redacted> + 2419 
    at 25  SwiftUI                             0x1c464916b        <redacted> + 387 
    at 26  SwiftUI                             0x1c46324bb        <redacted> + 2867 
    at 27  ios                                 0x1042a5b87        main + 35 
    at 28  dyld                                0x1df26495f        <redacted> + 2527 
xxfast commented 1 year ago

Duplicate of #44, keeping that open as it got more info