From 44cf0721c949668906c0cf7723df3f13cb2234f9 Mon Sep 17 00:00:00 2001 From: Desislava Stefanova Date: Fri, 25 Aug 2023 16:39:27 +0300 Subject: [PATCH] Remove not needed code constants from bindings --- ffigen/config.yaml | 2 - ffigen/realm/error_codes.h | 1 - lib/src/native/realm_bindings.dart | 72 ------------------------------ lib/src/native/realm_core.dart | 1 + lib/src/session.dart | 3 ++ src/realm-core | 2 +- 6 files changed, 5 insertions(+), 76 deletions(-) delete mode 120000 ffigen/realm/error_codes.h diff --git a/ffigen/config.yaml b/ffigen/config.yaml index 51d0b5e95..f5765b87f 100644 --- a/ffigen/config.yaml +++ b/ffigen/config.yaml @@ -5,7 +5,6 @@ description: "Binding for the realm-core C API" headers: entry-points: - 'realm.h' - - 'realm/error_codes.h' - 'realm_dart.h' - 'realm_dart_logger.h' - 'realm_dart_decimal128.h' @@ -13,7 +12,6 @@ headers: - 'realm_dart_sync.h' include-directives: # generate only for these headers - 'realm.h' - - 'realm/error_codes.h' - 'realm_dart.h' - 'realm_dart_logger.h' - 'realm_dart_decimal128.h' diff --git a/ffigen/realm/error_codes.h b/ffigen/realm/error_codes.h deleted file mode 120000 index c0af17963..000000000 --- a/ffigen/realm/error_codes.h +++ /dev/null @@ -1 +0,0 @@ -C:/_REALM/realm-dart/src/realm-core/src/realm/error_codes.h \ No newline at end of file diff --git a/lib/src/native/realm_bindings.dart b/lib/src/native/realm_bindings.dart index a626e2531..646cd8dfe 100644 --- a/lib/src/native/realm_bindings.dart +++ b/lib/src/native/realm_bindings.dart @@ -11436,23 +11436,6 @@ final class realm_error extends ffi.Struct { } typedef realm_error_categories = ffi.UnsignedInt; - -abstract class realm_error_category { - static const int RLM_ERR_CAT_LOGIC = 2; - static const int RLM_ERR_CAT_RUNTIME = 4; - static const int RLM_ERR_CAT_INVALID_ARG = 8; - static const int RLM_ERR_CAT_FILE_ACCESS = 16; - static const int RLM_ERR_CAT_SYSTEM_ERROR = 32; - static const int RLM_ERR_CAT_APP_ERROR = 64; - static const int RLM_ERR_CAT_CLIENT_ERROR = 128; - static const int RLM_ERR_CAT_JSON_ERROR = 256; - static const int RLM_ERR_CAT_SERVICE_ERROR = 512; - static const int RLM_ERR_CAT_HTTP_ERROR = 1024; - static const int RLM_ERR_CAT_CUSTOM_ERROR = 2048; - static const int RLM_ERR_CAT_WEBSOCKET_ERROR = 4096; - static const int RLM_ERR_CAT_SYNC_ERROR = 8192; -} - typedef realm_error_t = realm_error; final class realm_flx_sync_mutable_subscription_set extends ffi.Opaque {} @@ -11930,61 +11913,6 @@ typedef realm_sync_connection_state_changed_func_t = ffi.Pointer< ffi.Void Function(ffi.Pointer userdata, ffi.Int32 old_state, ffi.Int32 new_state)>>; -abstract class realm_sync_errno_connection { - static const int RLM_SYNC_ERR_CONNECTION_CONNECTION_CLOSED = 100; - static const int RLM_SYNC_ERR_CONNECTION_OTHER_ERROR = 101; - static const int RLM_SYNC_ERR_CONNECTION_UNKNOWN_MESSAGE = 102; - static const int RLM_SYNC_ERR_CONNECTION_BAD_SYNTAX = 103; - static const int RLM_SYNC_ERR_CONNECTION_LIMITS_EXCEEDED = 104; - static const int RLM_SYNC_ERR_CONNECTION_WRONG_PROTOCOL_VERSION = 105; - static const int RLM_SYNC_ERR_CONNECTION_BAD_SESSION_IDENT = 106; - static const int RLM_SYNC_ERR_CONNECTION_REUSE_OF_SESSION_IDENT = 107; - static const int RLM_SYNC_ERR_CONNECTION_BOUND_IN_OTHER_SESSION = 108; - static const int RLM_SYNC_ERR_CONNECTION_BAD_MESSAGE_ORDER = 109; - static const int RLM_SYNC_ERR_CONNECTION_BAD_DECOMPRESSION = 110; - static const int RLM_SYNC_ERR_CONNECTION_BAD_CHANGESET_HEADER_SYNTAX = 111; - static const int RLM_SYNC_ERR_CONNECTION_BAD_CHANGESET_SIZE = 112; - static const int RLM_SYNC_ERR_CONNECTION_SWITCH_TO_FLX_SYNC = 113; - static const int RLM_SYNC_ERR_CONNECTION_SWITCH_TO_PBS = 114; -} - -abstract class realm_sync_errno_session { - static const int RLM_SYNC_ERR_SESSION_SESSION_CLOSED = 200; - static const int RLM_SYNC_ERR_SESSION_OTHER_SESSION_ERROR = 201; - static const int RLM_SYNC_ERR_SESSION_TOKEN_EXPIRED = 202; - static const int RLM_SYNC_ERR_SESSION_BAD_AUTHENTICATION = 203; - static const int RLM_SYNC_ERR_SESSION_ILLEGAL_REALM_PATH = 204; - static const int RLM_SYNC_ERR_SESSION_NO_SUCH_REALM = 205; - static const int RLM_SYNC_ERR_SESSION_PERMISSION_DENIED = 206; - static const int RLM_SYNC_ERR_SESSION_BAD_SERVER_FILE_IDENT = 207; - static const int RLM_SYNC_ERR_SESSION_BAD_CLIENT_FILE_IDENT = 208; - static const int RLM_SYNC_ERR_SESSION_BAD_SERVER_VERSION = 209; - static const int RLM_SYNC_ERR_SESSION_BAD_CLIENT_VERSION = 210; - static const int RLM_SYNC_ERR_SESSION_DIVERGING_HISTORIES = 211; - static const int RLM_SYNC_ERR_SESSION_BAD_CHANGESET = 212; - static const int RLM_SYNC_ERR_SESSION_PARTIAL_SYNC_DISABLED = 214; - static const int RLM_SYNC_ERR_SESSION_UNSUPPORTED_SESSION_FEATURE = 215; - static const int RLM_SYNC_ERR_SESSION_BAD_ORIGIN_FILE_IDENT = 216; - static const int RLM_SYNC_ERR_SESSION_BAD_CLIENT_FILE = 217; - static const int RLM_SYNC_ERR_SESSION_SERVER_FILE_DELETED = 218; - static const int RLM_SYNC_ERR_SESSION_CLIENT_FILE_BLACKLISTED = 219; - static const int RLM_SYNC_ERR_SESSION_USER_BLACKLISTED = 220; - static const int RLM_SYNC_ERR_SESSION_TRANSACT_BEFORE_UPLOAD = 221; - static const int RLM_SYNC_ERR_SESSION_CLIENT_FILE_EXPIRED = 222; - static const int RLM_SYNC_ERR_SESSION_USER_MISMATCH = 223; - static const int RLM_SYNC_ERR_SESSION_TOO_MANY_SESSIONS = 224; - static const int RLM_SYNC_ERR_SESSION_INVALID_SCHEMA_CHANGE = 225; - static const int RLM_SYNC_ERR_SESSION_BAD_QUERY = 226; - static const int RLM_SYNC_ERR_SESSION_OBJECT_ALREADY_EXISTS = 227; - static const int RLM_SYNC_ERR_SESSION_SERVER_PERMISSIONS_CHANGED = 228; - static const int RLM_SYNC_ERR_SESSION_INITIAL_SYNC_NOT_COMPLETED = 229; - static const int RLM_SYNC_ERR_SESSION_WRITE_NOT_ALLOWED = 230; - static const int RLM_SYNC_ERR_SESSION_COMPENSATING_WRITE = 231; - static const int RLM_SYNC_ERR_SESSION_MIGRATE_TO_FLX = 232; - static const int RLM_SYNC_ERR_SESSION_BAD_PROGRESS = 233; - static const int RLM_SYNC_ERR_SESSION_REVERT_TO_PBS = 234; -} - final class realm_sync_error extends ffi.Struct { external realm_error_t status; diff --git a/lib/src/native/realm_core.dart b/lib/src/native/realm_core.dart index 3b734005b..a216ab6e4 100644 --- a/lib/src/native/realm_core.dart +++ b/lib/src/native/realm_core.dart @@ -3406,6 +3406,7 @@ extension on realm_error { } } +/// @nodoc class SyncErrorCodesConstants { static const runtimeError = realm_errno.RLM_ERR_RUNTIME; //Sync static const objectAlreadyExists = realm_errno.RLM_ERR_OBJECT_ALREADY_EXISTS; //Sync diff --git a/lib/src/session.dart b/lib/src/session.dart index 79942f89f..9d0f62d74 100644 --- a/lib/src/session.dart +++ b/lib/src/session.dart @@ -588,6 +588,9 @@ enum SyncWebSocketErrorCode { const SyncWebSocketErrorCode(this.code); } +/// Sync errors caused by the client, server or the connection. +/// +/// These errors will be reported via the error handlers of the affected sessions. enum SyncErrorCode { /// Connection closed by the server connectionClosed(SyncErrorCodesConstants.connectionClosed), diff --git a/src/realm-core b/src/realm-core index ea7c5d5e2..dc52d7738 160000 --- a/src/realm-core +++ b/src/realm-core @@ -1 +1 @@ -Subproject commit ea7c5d5e2900b8411a295aea3d1aa56aa55fff1d +Subproject commit dc52d7738ae7fdba5dab7cd6df589844147adc6d