ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
512 stars 106 forks source link

SQLitePCLRaw.bundle_e_sqlite3 using old System.Text.JJSON #422

Closed huyvuskedulo closed 2 years ago

huyvuskedulo commented 3 years ago

Describe the bug Alright, so the problem is I'm trying to implement Sentry.io package (Sentry.Xamarin.Forms) into my project. It's fine if i tried to implement it in a blank Xamarin project. The problem is when i tried to install it with a project that also has "Akavache", it's unable to send the error because of this

Here is the issue i reported from Akavache, but it turn out it's might be a problem for SQLitePCLRaw.bundle_e_sqlite3 (a dependency of Akavache): https://github.com/reactiveui/Akavache/issues/680

And this is the repo that you can use (click on a cat to see the error logs from console) https://github.com/unamed000/my-cat-demo/tree/sentry-error

Error: Failed to send cached envelope: System.MissingMethodException: Method not found: System.Text.Json.JsonDocument System.Text.Json.JsonDocument.Parse(System.ReadOnlyMemory`1<byte>,System.Text.Json.JsonDocumentOptions)
  at Sentry.Protocol.Envelopes.Envelope.DeserializeHeaderAsync (System.IO.Stream stream, System.Threading.CancellationToken cancellationToken) [0x001a1] in /_/src/Sentry/Envelopes/Envelope.cs:152 
  at Sentry.Protocol.Envelopes.Envelope.DeserializeAsync (System.IO.Stream stream, System.Threading.CancellationToken cancellationToken) [0x00032] in /_/src/Sentry/Envelopes/Envelope.cs:164 
  at Sentry.Internal.Http.CachingTransport.ProcessCacheAsync (System.Threading.CancellationToken cancellationToken) [0x00117] in /_/src/Sentry/Internal/Http/CachingTransport.cs:173 , discarding cached envelope.
2021-06-04 13:10:15.969986+0700 MyCats.iOS[24822:748467]   Debug: No cached file to process.

After i removed Akavache from my project (and Restore the package for the project) it's running fine again. So Akavache must be using some System.Text.Json in the old version which make the iOS project to run System.Text in that version instead of the latest version coming from Sentry.

Steps To Reproduce

Expected behavior The logs should state that the message is successfully sent to Sentry.

But it was not

Screenshots

image

Environment

glennawatson commented 3 years ago

@huyvuskedulo submitted a task to the Akavache repo and I redirected him here after testing with just the SQLiteRaw dependency @ericsink

Something weird is happening with including older versions of System.Text.Json

ericsink commented 3 years ago

Looks like maybe this has been resolved over in the sentry repo...