realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.47k stars 1.75k forks source link

Wrong sync error codes #7823

Closed josias-milk closed 1 year ago

josias-milk commented 1 year ago

How frequently does the bug occur?

Always

Description

Some realm sync errors are reported with error code UNKNOWN which previously had a specific error code. For example permission denied error was logged like this in realm 10.13.1: PERMISSION_DENIED(realm::sync::ProtocolError:206): Permission denied (BIND, IDENT, QUERY, REFRESH)

In realm 10.16.0 it looks like this: UNKNOWN(unknown:1999): Permission denied (BIND, IDENT, QUERY, REFRESH)

The same happens for the the bad progress error: realm 10.13.1: CLIENT_BAD_PROGRESS(realm::sync::ClientError:107): Bad progress information (DOWNLOAD)

realm 10.16.10: UNKNOWN(unknown:1999): Bad progress information (DOWNLOAD)

This breaks the error handling in our app.

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

Open a realm with a SyncConfiguration and an error handler which logs the errors.

Version

10.16.0

What Atlas App Services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

Android 11, 13

Build environment

Android Studio version: Electric Eel | 2022.1.1 Patch 2 Android Build Tools version: 33.0.1 Gradle version: 7.5

clementetb commented 1 year ago

Thanks for the report, we are investigating the issue.

cmelchior commented 1 year ago

We can reproduce this and are working on a fix.