Realm is a mobile database: an alternative to SQLite & key-value stores

Overview

Realm

Realm is a mobile database that runs directly inside phones, tablets or wearables. This project hosts the JavaScript versions of Realm. Currently we support React Native (both iOS & Android), Node.js and Electron (on Windows, MacOS and Linux).

Features

  • Mobile-first: Realm is the first database built from the ground up to run directly inside phones, tablets and wearables.
  • Simple: Data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues.
  • Modern: Realm supports relationships, generics, and vectorization.
  • Fast: Realm is faster than even raw SQLite on common operations, while maintaining an extremely rich feature set.

Getting Started

Please see the detailed instructions in our docs to use Realm JavaScript for node.js and Realm JavaScript for React Native. Please notice that currently only node.js version 10 or later (excluding 11) are supported.

Documentation

Realm React Native and Node.js

The documentation can be found at docs.mongodb.com/realm/react-native/. The API reference is located at docs.mongodb.com/realm-sdks/js/latest/.

Getting Help

  • Need help with your code?: Look for previous questions on the #realm tag — or ask a new question. You can also check out our Community Forum where general questions about how to do something can be discussed.
  • Have a bug to report? Open an issue. If possible, include the version of Realm, a full log, the Realm file, and a project that shows the issue.
  • Have a feature request? Open an issue. Tell us what the feature should do, and why you want the feature.

Building Realm

In case you don't want to use the precompiled version on npm, you can build Realm yourself from source. You’ll need an Internet connection the first time you build in order to download the core library.

Prerequisites:

  • Xcode 12+
  • node.js version 10.19 or later
  • nvm (on Mac and Linux)
  • cocoapods (on Mac)
  • Android SDK 23+
  • Android NDK 21.0
    • Available via the SDK Manager in Android Studio Tools > SDK Manager.
    • From the command-line: $ANDROID_SDK_ROOT/tools/bin/sdkmanager --install "ndk;21.0.6113669".
  • Android CMake
    • Available via the SDK Manager in Android Studio Tools > SDK Manager
    • From the command-line ```$ANDROID_SDK_ROOT/tools/bin/sdkmanager --install "cmake;3.18.1"````

Clone RealmJS repository:

git clone https://github.com/realm/realm-js.git
cd realm-js
git submodule update --init --recursive

Note: On Windows the RealmJS repo should be cloned with symlinks enabled

#run in elevated command prompt
git clone -c core.symlinks=true https://github.com/realm/realm-js

or manually create the symlinks using directory junctions if you already have the repo cloned.

#run in elevated command prompt
cd realm-js\react-native\android\src\main\jni
#remove src and vendor files
del src
del vendor
mklink /j "src" "../../../../../src/"
mklink /j "vendor" "../../../../../vendor"
cd realm-js\tests\react-test-app\android\app\src\main
#remove assets file
del assets
mklink /j assets "../../../../../data"

Note: If you have cloned the repo previously make sure you remove your node_modules directory since it may contain stale dependencies which may cause the build to fail.

Building for iOS:

  • Open react-native/ios/RealmReact.xcodeproj in Xcode
  • Select RealmReact under Targets
  • Build: ⌘ + B

Building for Android:

  • cd react-native/android
  • export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.0.6113669 #Location for your NDK folder
  • ./gradlew publishAndroid
  • The compiled version of the Android module is here: <project-root>/android

Building for nodejs:

Be sure you have python2.7 as the default python. 3.x won't work, and it's not enough to use --python=python2.7 as parameter to npm. For example you can use Homebrew to install it.

brew install python@2
npm install --build-from-source=realm

Additional steps for Windows

On Windows you will need to setup the environment for node-gyp:

  • Option 1: Install windows-build-tools node package

    # run in elevated command prompt (as Administrator)
    npm install -g --production windows-build-tools
    
  • Option 2: Manually install and configure as described in the node-gyp manual.

    Note you may need to configure the build tools path using npm

    npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
    

You also need to install openssl libraries with vcpkg:

git clone https://github.com/Microsoft/vcpkg
cd vcpkg
bootstrap-vcpkg.bat
vcpkg install openssl:x64-windows-static
mkdir C:\src\vcpkg\installed\x64-windows-static\lib
copy .\packages\openssl-windows_x64-windows-static\lib\libeay32.lib C:\src\vcpkg\installed\x64-windows-static\lib\
copy .\packages\openssl-windows_x64-windows-static\lib\ssleay32.lib C:\src\vcpkg\installed\x64-windows-static\lib

Installing the project's sub-packages

We've decided to slowly migrate this repository to a mono-repository containing multiple packages (stored in the ./packages directory), to install & link these, run

npx lerna bootstrap

Please familiarise yourself with Lerna to learn how to add dependencies to these packages.

Building docs

API documentation is written using JSDoc.

  • npm run jsdoc

The generated docs can be found by opening docs/output/realm/<version>/index.html.

Debugging the node addon

You can use Visual Studio Code to develop and debug. In the .vscode folder, configuration for building and debugging has been added for your convience.

VSCode has good support for debugging JavaScript, but to work with C++ code, you are required to install two additional VSCode extensions:

  • Microsoft C/C++
  • CodeLLDB

To begin, you will need to build the node addon and prepare the test environment:

npm install --build-from-source --debug
(cd tests && npm install)

Prior to begin debugging, you must start Realm Object Server. In VSCode, under menu Tasks/Run Task, find Download and Start Server.

In the debugging pane, you can find Debug LLDB + NodeJS in the dropdown. First select Start Debugging in the Debug menu.

Issues with debugging

Some users have reported the Chrome debugging being too slow to use after integrating Realm into their react-native project. This is due to the blocking nature of the RPC calls made through the Realm library. See https://github.com/realm/realm-js/issues/491 for more information. The best workaround is to use Safari instead, as a user has described here.

Running the tests

The tests will spawn a new shell when running, so you need to make sure that new shell instances use the correct version of npm. On Mac you can use Homebrew and you can add the following to your prefered shell setup:

export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"

Install cocoapods

sudo gem install cocoapods

You can now use scripts/test.sh to run the various tests. You will need yarn installed on the machine.

test.sh options

  • eslint - lints the sources
  • react-tests - runs all React Native tests on iOS Simulator
  • react-tests-android runs all React Native Android tests on Android emulator
  • node - runs all tests for node
  • test-runners - checks supported tests runners are working correctly

If you modify or add a test, please remove tests/react-test-app/node_modules/realm-tests before running test.sh (of course, only if you are testing with React Native).

Testing on Windows

On Windows some of these targets are available as npm commands.

npm run eslint
npm run node-tests
npm run test-runners

Debugging the tests

You can attach a debugger to react-native tests by passing "Debug" to the test.sh script. A Chrome browser will open and connect to the react native application. Use the built-in Chrome Debugger to debug the code.

./scripts/tests.sh react-tests Debug

Using Visual Studio Code

You can debug node tests using Visual Studio Code. Just use one of the launch configurations.

Analytics

Asynchronously submits install information to Realm.

Why are we doing this? In short, because it helps us build a better product for you. None of the data personally identifies you, your employer or your app, but it will help us understand what language you use, what Node.js versions you target, etc. Having this info will help prioritizing our time, adding new features and deprecating old features. Collecting an anonymized application path & anonymized machine identifier is the only way for us to count actual usage of the other metrics accurately. If we don’t have a way to deduplicate the info reported, it will be useless, as a single developer npm install-ing the same app 10 times would report 10 times more than another developer that only installs once, making the data all but useless. No one likes sharing data unless it’s necessary, we get it, and we’ve debated adding this for a long long time. If you truly, absolutely feel compelled to not send this data back to Realm, then you can set an env variable named REALM_DISABLE_ANALYTICS.

Currently the following information is reported:

  • What version of Realm is being installed.
  • The OS platform and version which is being used.
  • Node.js, v8, libuv, OpenSSL version numbers.
  • An anonymous machine identifier and hashed application path to aggregate the other information on.

Known issues

  • AWS Lambda is not supported.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Contributing

See CONTRIBUTING.md for more details!

License

Realm JS and Realm Core are published under the Apache License 2.0.

This product is not being made available to any person located in Cuba, Iran, North Korea, Sudan, Syria or the Crimea region, or to any other person that is not eligible to receive the product under U.S. law.

Feedback

If you use Realm and are happy with it, all we ask is that you please consider sending out a tweet mentioning @realm to share your thoughts

And if you don't like it, please let us know what you would like improved, so we can fix it!

analytics

Comments
  • Support Hermes engine

    Support Hermes engine

    Goals

    Make Hermes engine to work with Realm. Hermes comes from react-native 0.60.2 and significantly improves app performance on Android.

    Steps to Reproduce

    Following https://facebook.github.io/react-native/docs/hermes. if enableHermes: true, you will get the following:

    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: librealmreact.so caused by: dlopen failed: library "libjsc.so" not found
            at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
            at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
            at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
            at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
            at io.realm.react.RealmReactModule.<clinit>(RealmReactModule.java:56)
            at io.realm.react.RealmReactPackage.createNativeModules(RealmReactPackage.java:31)
    

    With enableHermes: false, everything works as expected.

    Version of Realm and Tooling

    • Realm JS SDK Version: 2.28.1
    • React Native: 0.60.3
    T-Feature O-Community Pipeline-Soon-Backlog 
    opened by ferrannp 138
  • Feedback on Hermes support

    Feedback on Hermes support

    We are working hard on getting Hermes supported by Realm JavaScript, and we are releasing a series of pre-releases to test our progress.

    We encourage you to try out the pre-release in your development environment (don't use it in production yet). Create a new issue with your observations, including details about iOS version, other JavaScript libraries. Please use the Hermes issue template.

    We appreciate your feedback, but we cannot guarantee if and when we respond to your comment.

    Current state

    • Version: v11.0.0-rc.1 (or v11.0.0-rc.0 if you're using a React Native version between 0.66.0 and 0.68.2)
    • Both iOS and Android are supported
    • Required React Native version is 0.69.0 or above 👈 this is very important, since JSI is not ABI stable and your app will simply crash if the version isn't correct. Use v11.0.0-rc.0 for older versions of React Native).
    • 0 of 276 tests are failing

    Installation

    We are keeping the pre-releases under the tag hermes, and you can install the latest pre-release using the following command:

    npm install realm@hermes
    

    For a more comprehensive list of TODOs, please see our PR and the source code for TODO comments.

    T-Bug Reproduction-Required hermes 
    opened by kneth 94
  • [iOS][Expo SDK 46] SIGTRAP/SIGILL crash on Release Build Configuration

    [iOS][Expo SDK 46] SIGTRAP/SIGILL crash on Release Build Configuration

    Description

    After upgrading to Expo SDK 46 beta-6, we started getting a fatal crash on launch on iOS Release Configuration builds with [email protected] and hermes enabled. We managed to reproduce this crash 100% of the time on all Apple devices and simulators that we have tried, and on iOS 14/15.

    Stacktrace & log output

    -------------------------------------
    Translated Report (Full Report Below)
    -------------------------------------
    
    Incident Identifier: 2CB231A5-1C1C-4F62-B740-917566BF7B41
    CrashReporter Key:   958937CA-AE6A-3DEE-5690-64CE79CEB162
    Hardware Model:      MacBookPro18,3
    Process:             exporepro18317 [50036]
    Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/18E2A611-92EA-4CA2-9D5C-6EF8793B6E39/data/Containers/Bundle/Application/57D7F7C5-E9F0-40EA-82DE-ADC91BBA095C/exporepro18317.app/exporepro18317
    Identifier:          com.exporepro18317.exporepro18317
    Version:             1.0.0 (1)
    Code Type:           ARM-64 (Native)
    Role:                Foreground
    Parent Process:      launchd_sim [75757]
    Coalition:           com.apple.CoreSimulator.SimDevice.18E2A611-92EA-4CA2-9D5C-6EF8793B6E39 [25352]
    Responsible Process: SimulatorTrampoline [4038]
    
    Date/Time:           2022-07-21 23:24:28.9015 +0800
    Launch Time:         2022-07-21 23:24:28.7664 +0800
    OS Version:          macOS 12.4 (21F79)
    Release Type:        User
    Report Version:      104
    
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000001, 0x00000001026b75dc
    Exception Note:  EXC_CORPSE_NOTIFY
    Termination Reason: SIGNAL 5 Trace/BPT trap: 5
    Terminating Process: exc handler [50036]
    
    Triggered by Thread:  9
    
    Thread 0::  Dispatch queue: com.apple.main-thread
    0   UIKitCore                     	       0x1852ea448 +[UIView(Animation) performWithoutAnimation:] + 0
    1   UIKitCore                     	       0x184bbb668 +[UIRemoteKeyboardWindow remoteKeyboardWindowForScreen:create:] + 264
    2   UIKitCore                     	       0x184bc1b2c __44-[_UIRemoteKeyboards applicationWillResume:]_block_invoke + 172
    3   libdispatch.dylib             	       0x18010ea98 _dispatch_client_callout + 16
    4   libdispatch.dylib             	       0x180112268 _dispatch_block_invoke_direct + 244
    5   FrontBoardServices            	       0x1861b8074 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
    6   FrontBoardServices            	       0x1861b7f4c -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176
    7   FrontBoardServices            	       0x1861b80a4 -[FBSSerialQueue _performNextFromRunLoopSource] + 24
    8   CoreFoundation                	       0x180362234 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    9   CoreFoundation                	       0x180362134 __CFRunLoopDoSource0 + 204
    10  CoreFoundation                	       0x1803614c4 __CFRunLoopDoSources0 + 256
    11  CoreFoundation                	       0x18035ba18 __CFRunLoopRun + 744
    12  CoreFoundation                	       0x18035b218 CFRunLoopRunSpecific + 572
    13  GraphicsServices              	       0x18c25f60c GSEventRunModal + 160
    14  UIKitCore                     	       0x184d88a98 -[UIApplication _run] + 992
    15  UIKitCore                     	       0x184d8d634 UIApplicationMain + 112
    16  exporepro18317                	       0x1024dc2c0 main + 88 (main.m:7)
    17  dyld_sim                      	       0x103639cd8 start_sim + 20
    18  dyld                          	       0x1036d908c start + 520
    
    Thread 1:
    0   libsystem_pthread.dylib       	       0x1cc0ac8fc start_wqthread + 0
    
    Thread 2::  Dispatch queue: com.facebook.react.ShadowQueue
    0   libdispatch.dylib             	       0x18010fff8 dispatch_once + 0
    1   exporepro18317                	       0x1025dd5f8 dispatch_once + 16 (once.h:84) [inlined]
    2   exporepro18317                	       0x1025dd5f8 +[RCTI18nUtil sharedInstance] + 112 (RCTI18nUtil.m:18)
    3   exporepro18317                	       0x1025f43f8 -[RCTRootShadowView init] + 72 (RCTRootShadowView.m:18)
    4   exporepro18317                	       0x10260fe14 __33-[RCTUIManager registerRootView:]_block_invoke + 52 (RCTUIManager.m:326)
    5   libdispatch.dylib             	       0x18010d244 _dispatch_call_block_and_release + 24
    6   libdispatch.dylib             	       0x18010ea98 _dispatch_client_callout + 16
    7   libdispatch.dylib             	       0x180115acc _dispatch_lane_serial_drain + 652
    8   libdispatch.dylib             	       0x180116648 _dispatch_lane_invoke + 400
    9   libdispatch.dylib             	       0x180120e10 _dispatch_workloop_worker_thread + 736
    10  libsystem_pthread.dylib       	       0x1cc0adb40 _pthread_wqthread + 284
    11  libsystem_pthread.dylib       	       0x1cc0ac904 start_wqthread + 8
    
    Thread 3:
    0   libsystem_pthread.dylib       	       0x1cc0ac8fc start_wqthread + 0
    
    Thread 4:
    0   libsystem_pthread.dylib       	       0x1cc0ac8fc start_wqthread + 0
    
    Thread 5::  Dispatch queue: com.apple.root.user-interactive-qos
    0   hermes                        	       0x10402de28 0x103f54000 + 892456
    1   hermes                        	       0x103f758f4 0x103f54000 + 137460
    2   hermes                        	       0x103f5ca14 0x103f54000 + 35348
    3   exporepro18317                	       0x1026b61c0 facebook::jsi::RuntimeDecorator<facebook::jsi::Runtime, facebook::jsi::Runtime>::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 36 (decorator.h:300) [inlined]
    4   exporepro18317                	       0x1026b61c0 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 96 (decorator.h:703)
    5   exporepro18317                	       0x102534478 facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Value const*, unsigned long) const + 68 (jsi-inl.h:249) [inlined]
    6   exporepro18317                	       0x102534478 facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, std::initializer_list<facebook::jsi::Value>) const + 68 (jsi-inl.h:256) [inlined]
    7   exporepro18317                	       0x102534478 -[EXJavaScriptObject defineProperty:value:options:] + 480 (EXJavaScriptObject.mm:94)
    8   exporepro18317                	       0x10253b444 +[EXJavaScriptRuntimeManager installExpoModulesHostObject:] + 300 (EXJSIInstaller.mm:49)
    9   exporepro18317                	       0x102574e0c $s15ExpoModulesCore10AppContextC07installaB10HostObjectyyKF + 28 (AppContext.swift:290) [inlined]
    10  exporepro18317                	       0x102574e0c $s15ExpoModulesCore10AppContextC7runtimeSo19EXJavaScriptRuntimeCSgvW + 32 (AppContext.swift:57) [inlined]
    11  exporepro18317                	       0x102574e0c $s15ExpoModulesCore10AppContextC7runtimeSo19EXJavaScriptRuntimeCSgvs + 32 [inlined]
    12  exporepro18317                	       0x102574e0c ExpoBridgeModule.javaScriptWillStartExecutingNotification(_:) + 564 (ExpoBridgeModule.swift:76)
    13  exporepro18317                	       0x102575014 @objc ExpoBridgeModule.javaScriptWillStartExecutingNotification(_:) + 112
    14  CoreFoundation                	       0x180332f90 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
    15  CoreFoundation                	       0x180332f48 ___CFXRegistrationPost_block_invoke + 48
    16  CoreFoundation                	       0x180332358 _CFXRegistrationPost + 416
    17  CoreFoundation                	       0x180331d48 _CFXNotificationPost + 692
    18  Foundation                    	       0x1807d9964 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
    19  exporepro18317                	       0x1025d29c0 __51-[RCTCxxBridge executeApplicationScript:url:async:]_block_invoke + 228 (RCTCxxBridge.mm:1504)
    20  exporepro18317                	       0x1025d7ae0 std::__1::__function::__value_func<void ()>::operator()() const + 20 (function.h:505) [inlined]
    21  exporepro18317                	       0x1025d7ae0 std::__1::function<void ()>::operator()() const + 20 (function.h:1182) [inlined]
    22  exporepro18317                	       0x1025d7ae0 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 32 (RCTCxxUtils.mm:74)
    23  exporepro18317                	       0x1025cc604 -[RCTCxxBridge _tryAndHandleError:] + 100 (RCTCxxBridge.mm:344)
    24  exporepro18317                	       0x1025d2878 -[RCTCxxBridge executeApplicationScript:url:async:] + 164 (RCTCxxBridge.mm:1502)
    25  exporepro18317                	       0x1025d26d4 -[RCTCxxBridge enqueueApplicationScript:url:onComplete:] + 88 (RCTCxxBridge.mm:1479)
    26  exporepro18317                	       0x1025d0398 -[RCTCxxBridge executeSourceCode:sync:] + 240 (RCTCxxBridge.mm:1079)
    27  exporepro18317                	       0x1025cda04 __21-[RCTCxxBridge start]_block_invoke_2 + 96 (RCTCxxBridge.mm:505)
    28  libdispatch.dylib             	       0x18010d244 _dispatch_call_block_and_release + 24
    29  libdispatch.dylib             	       0x18010ea98 _dispatch_client_callout + 16
    30  libdispatch.dylib             	       0x18011f8a0 _dispatch_root_queue_drain + 732
    31  libdispatch.dylib             	       0x1801200f4 _dispatch_worker_thread2 + 160
    32  libsystem_pthread.dylib       	       0x1cc0adb04 _pthread_wqthread + 224
    33  libsystem_pthread.dylib       	       0x1cc0ac904 start_wqthread + 8
    
    Thread 6:: com.apple.uikit.eventfetch-thread
    0   libsystem_kernel.dylib        	       0x1cc055fcc mach_msg_trap + 8
    1   libsystem_kernel.dylib        	       0x1cc056430 mach_msg + 72
    2   CoreFoundation                	       0x18036176c __CFRunLoopServiceMachPort + 368
    3   CoreFoundation                	       0x18035bb78 __CFRunLoopRun + 1096
    4   CoreFoundation                	       0x18035b218 CFRunLoopRunSpecific + 572
    5   Foundation                    	       0x180827828 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 232
    6   Foundation                    	       0x180827ae0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88
    7   UIKitCore                     	       0x184e3f01c -[UIEventFetcher threadMain] + 472
    8   Foundation                    	       0x180851578 __NSThread__start__ + 792
    9   libsystem_pthread.dylib       	       0x1cc0b16c8 _pthread_start + 116
    10  libsystem_pthread.dylib       	       0x1cc0ac910 thread_start + 8
    
    Thread 7:
    0   libsystem_pthread.dylib       	       0x1cc0ac8fc start_wqthread + 0
    
    Thread 8:
    0   libsystem_pthread.dylib       	       0x1cc0ac8fc start_wqthread + 0
    
    Thread 9 Crashed:: com.facebook.react.JavaScript
    0   exporepro18317                	       0x1026b75dc facebook::react::(anonymous namespace)::ReentrancyCheck::before() + 8 (HermesExecutorFactory.cpp:123) [inlined]
    1   exporepro18317                	       0x1026b75dc facebook::jsi::detail::BeforeCaller<facebook::react::(anonymous namespace)::ReentrancyCheck, void>::before(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 8 (decorator.h:418) [inlined]
    2   exporepro18317                	       0x1026b75dc facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 8 (decorator.h:743) [inlined]
    3   exporepro18317                	       0x1026b75dc facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 112 (decorator.h:742)
    4   exporepro18317                	       0x1026b7588 std::__1::__libcpp_thread_get_current_id() + 4 (__threading_support:426) [inlined]
    5   exporepro18317                	       0x1026b7588 std::__1::this_thread::get_id() + 4 (__threading_support:715) [inlined]
    6   exporepro18317                	       0x1026b7588 facebook::react::(anonymous namespace)::ReentrancyCheck::before() + 4 (HermesExecutorFactory.cpp:87) [inlined]
    7   exporepro18317                	       0x1026b7588 facebook::jsi::detail::BeforeCaller<facebook::react::(anonymous namespace)::ReentrancyCheck, void>::before(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 4 (decorator.h:418) [inlined]
    8   exporepro18317                	       0x1026b7588 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 8 (decorator.h:743) [inlined]
    9   exporepro18317                	       0x1026b7588 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 28 (decorator.h:742)
    10  exporepro18317                	       0x1026b5400 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::createStringFromAscii(char const*, unsigned long) + 48 (decorator.h:574)
    11  exporepro18317                	       0x10272f9e4 facebook::jsi::Value facebook::jsi::Function::call<char const (&) [11], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(facebook::jsi::Runtime&, char const (&) [11], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) const + 96
    12  exporepro18317                	       0x102720ecc realm::js::realmjsi::ObjectWrap<realm::js::ObservableClass<realm::js::realmjsi::Types> >::create_constructor(realm::js::JsiEnv) + 548
    13  exporepro18317                	       0x10271eb70 realm::js::RealmClass<realm::js::realmjsi::Types>::create_constructor(realm::js::JsiEnv) + 44
    14  exporepro18317                	       0x10271e9ac realm_jsi_init + 184
    15  exporepro18317                	       0x102701700 __24-[RealmReact setBridge:]_block_invoke + 408 (RealmReact.mm:156)
    16  exporepro18317                	       0x1025d7ae0 std::__1::__function::__value_func<void ()>::operator()() const + 20 (function.h:505) [inlined]
    17  exporepro18317                	       0x1025d7ae0 std::__1::function<void ()>::operator()() const + 20 (function.h:1182) [inlined]
    18  exporepro18317                	       0x1025d7ae0 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 32 (RCTCxxUtils.mm:74)
    19  exporepro18317                	       0x1025cc604 -[RCTCxxBridge _tryAndHandleError:] + 100 (RCTCxxBridge.mm:344)
    20  Foundation                    	       0x180851928 __NSThreadPerformPerform + 164
    21  CoreFoundation                	       0x180362234 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    22  CoreFoundation                	       0x180362134 __CFRunLoopDoSource0 + 204
    23  CoreFoundation                	       0x1803614c4 __CFRunLoopDoSources0 + 256
    24  CoreFoundation                	       0x18035ba18 __CFRunLoopRun + 744
    25  CoreFoundation                	       0x18035b218 CFRunLoopRunSpecific + 572
    26  exporepro18317                	       0x1025cc538 +[RCTCxxBridge runRunLoop] + 264 (RCTCxxBridge.mm:335)
    27  Foundation                    	       0x180851578 __NSThread__start__ + 792
    28  libsystem_pthread.dylib       	       0x1cc0b16c8 _pthread_start + 116
    29  libsystem_pthread.dylib       	       0x1cc0ac910 thread_start + 8
    
    Thread 10:: hades
    0   libsystem_kernel.dylib        	       0x1cc059694 __psynch_cvwait + 8
    1   libsystem_pthread.dylib       	       0x1cc0b1c88 _pthread_cond_wait + 1224
    2   libc++.1.dylib                	       0x18026718c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
    3   hermes                        	       0x104063934 0x103f54000 + 1112372
    4   hermes                        	       0x1040636e8 0x103f54000 + 1111784
    5   libsystem_pthread.dylib       	       0x1cc0b16c8 _pthread_start + 116
    6   libsystem_pthread.dylib       	       0x1cc0ac910 thread_start + 8
    
    Thread 11:: hermes-chrome-inspector-conn
    0   libsystem_kernel.dylib        	       0x1cc059694 __psynch_cvwait + 8
    1   libsystem_pthread.dylib       	       0x1cc0b1c88 _pthread_cond_wait + 1224
    2   libc++.1.dylib                	       0x18026718c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
    3   exporepro18317                	       0x1026de204 void std::__1::condition_variable::wait<facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1>(std::__1::unique_lock<std::__1::mutex>&, facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1) + 28 (__mutex_base:404) [inlined]
    4   exporepro18317                	       0x1026de204 facebook::hermes::inspector::detail::SerialExecutor::runLoop() + 120 (SerialExecutor.cpp:41)
    5   exporepro18317                	       0x1026a1adc decltype(static_cast<void (*>(fp)(static_cast<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >>(fp0), static_cast<std::__1::function<void ()>>(fp0))) std::__1::__invoke<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >(void (*&&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::function<void ()>&&) + 52 (type_traits:3918) [inlined]
    6   exporepro18317                	       0x1026a1adc void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >&, std::__1::__tuple_indices<2ul, 3ul>) + 56 (thread:287) [inlined]
    7   exporepro18317                	       0x1026a1adc void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> > >(void*) + 116 (thread:298)
    8   libsystem_pthread.dylib       	       0x1cc0b16c8 _pthread_start + 116
    9   libsystem_pthread.dylib       	       0x1cc0ac910 thread_start + 8
    
    Thread 12:: hermes-inspector
    0   libsystem_kernel.dylib        	       0x1cc059694 __psynch_cvwait + 8
    1   libsystem_pthread.dylib       	       0x1cc0b1c88 _pthread_cond_wait + 1224
    2   libc++.1.dylib                	       0x18026718c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
    3   exporepro18317                	       0x1026de204 void std::__1::condition_variable::wait<facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1>(std::__1::unique_lock<std::__1::mutex>&, facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1) + 28 (__mutex_base:404) [inlined]
    4   exporepro18317                	       0x1026de204 facebook::hermes::inspector::detail::SerialExecutor::runLoop() + 120 (SerialExecutor.cpp:41)
    5   exporepro18317                	       0x1026a1adc decltype(static_cast<void (*>(fp)(static_cast<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >>(fp0), static_cast<std::__1::function<void ()>>(fp0))) std::__1::__invoke<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >(void (*&&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::function<void ()>&&) + 52 (type_traits:3918) [inlined]
    6   exporepro18317                	       0x1026a1adc void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> >&, std::__1::__tuple_indices<2ul, 3ul>) + 56 (thread:287) [inlined]
    7   exporepro18317                	       0x1026a1adc void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void ()> > >(void*) + 116 (thread:298)
    8   libsystem_pthread.dylib       	       0x1cc0b16c8 _pthread_start + 116
    9   libsystem_pthread.dylib       	       0x1cc0ac910 thread_start + 8
    
    
    Thread 9 crashed with ARM Thread State (64-bit):
        x0: 0x000000016de0f000   x1: 0x0000600003cb1d88   x2: 0x000000000000000a   x3: 0x00000001cc0a2b0b
        x4: 0x0000000001000008   x5: 0x0000000000000030   x6: 0x0000000000000000   x7: 0x0000000107ffcccc
        x8: 0x000000016dbdf000   x9: 0xa3bcaf80f146c3c5  x10: 0x0000000000179f41  x11: 0x00000000000b37f0
       x12: 0x0000000149600000  x13: 0x0000000000000000  x14: 0x00000000006d17d5  x15: 0x0000000000e2c6c0
       x16: 0x00000001cc0ad2c8  x17: 0x000000000000e2c6  x18: 0x0000000000000000  x19: 0x000000016de0d778
       x20: 0x0000600003cb1d88  x21: 0x0000600003cb1d58  x22: 0x000000016de0d7b8  x23: 0x0000000102c6dab5
       x24: 0x0000600000d9ae40  x25: 0x000000014a83d048  x26: 0x000000002b3100d5  x27: 0x0000000102d80000
       x28: 0x00000001da9cf000   fp: 0x000000016de0d760   lr: 0x00000001026b7588
        sp: 0x000000016de0d750   pc: 0x00000001026b75dc cpsr: 0x20001000
       far: 0x000000010272f984  esr: 0xf2000001 (Breakpoint) brk 1
    
    Binary Images:
           0x18417b000 -        0x18560dfff com.apple.UIKitCore (1.0) <7bbc9f13-df06-3c47-9a63-8483442bdfcb> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
           0x18010b000 -        0x18014dfff libdispatch.dylib (*) <a06c95dc-09e7-3a87-afb6-7e1b0bec1287> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib
           0x18615d000 -        0x1861e6fff com.apple.FrontBoardServices (765.10) <bc3a0db0-7ff7-38cb-bb7d-7986d5d239ef> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices
           0x1802dc000 -        0x18068bfff com.apple.CoreFoundation (6.9) <673c8a21-98bf-38f0-a038-55ab0de23142> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
           0x18c25c000 -        0x18c264fff com.apple.GraphicsServices (1.0) <9334a354-2177-30b1-b919-4fecf59fef22> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
           0x1024d8000 -        0x102ccffff com.exporepro18317.exporepro18317 (1.0.0) <ca210b1b-d549-38b1-9982-49a1a2baf6ed> /Users/USER/Library/Developer/CoreSimulator/Devices/18E2A611-92EA-4CA2-9D5C-6EF8793B6E39/data/Containers/Bundle/Application/57D7F7C5-E9F0-40EA-82DE-ADC91BBA095C/exporepro18317.app/exporepro18317
           0x103638000 -        0x103673fff dyld_sim (*) <67298116-bb18-3438-b22e-8d2b9d4618e9> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
           0x1036d4000 -        0x103733fff dyld (*) <d9c2a46e-8dc4-3950-9d6a-f799e8ccb683> /usr/lib/dyld
           0x1cc0aa000 -        0x1cc0b6fff libsystem_pthread.dylib (*) <f354eadf-ba89-3191-bbdd-9f36eda1f6ca> /usr/lib/system/libsystem_pthread.dylib
           0x103f54000 -        0x1041e7fff dev.hermesengine.iphonesimulator (0.11.0) <2c03abcd-37c8-3282-9295-30ebb35366e4> /Users/USER/Library/Developer/CoreSimulator/Devices/18E2A611-92EA-4CA2-9D5C-6EF8793B6E39/data/Containers/Bundle/Application/57D7F7C5-E9F0-40EA-82DE-ADC91BBA095C/exporepro18317.app/Frameworks/hermes.framework/hermes
           0x180700000 -        0x1809c3fff com.apple.Foundation (6.9) <ded71e05-af0a-3172-b09e-7f070ec7d4aa> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation
           0x1cc055000 -        0x1cc08afff libsystem_kernel.dylib (*) <d7107c39-03e1-32e1-9488-821b52158a1e> /usr/lib/system/libsystem_kernel.dylib
           0x18025b000 -        0x1802b6fff libc++.1.dylib (*) <03a5f91e-2bc5-3d4f-b91f-729633a08579> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib
    
    EOF
    

    Can you reproduce a bug?

    Yes, always

    Reproduction Steps

    Minimal repro can be found here.

    Version

    11.0.0-rc.1

    What SDK flavour are you using?

    Atlas App Services (auth, functions, etc.)

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    All iOS versions

    O-Community hermes 
    opened by thespacemanatee 68
  • Infinite loop of

    Infinite loop of "callbacks_poll"

    So, it's YOU! :-)

    I've been seeing this endless loop of "callbacks_poll" that is killing my debugging performance and pleasure.

    screen shot 2017-11-24 at 17 11 55

    Goals

    Get rid of the endless loop of callbacks_poll in my networking request pane and the associated memory leak

    Expected Results

    No callbacks_poll visible and no memory leak

    Actual Results

    See image. Endless loop. Makes it hard to identify individual network requests and there seems to be an associated memory leak, although I can't guarantee that it is related.

    Steps to Reproduce

    Not sure. This happened after I upgraded Realm but I didn't realize it at the time. Here's my Realm setup

    Code Sample

    class User {}
    User.schema = {
    	name: 'User',
    	primaryKey: 'id',
    	properties: {
    		id: { type: 'int' },
    		nickName: { type: 'string' },
    		displayName: { type: 'string' },
    		title: { type: 'string', optional: true },
    		email: { type: 'string' },
    		photo: { type: 'string', optional: true },
    		photoDir: { type: 'string' },
    		gender: { type: 'string' },
    		refId: { type: 'string', optional: true },
    		sessionToken: { type: 'string', optional: true }
    	}
    };
    
    export default User;
    
    
    import Realm from 'realm';
    import { logoutUser } from 'modules/login/actions/loginActions';
    import { delToken, clearTokens } from 'modules/login/actions/oauthActions';
    import * as config from 'config';
    import { dbg } from 'utils';
    import UserRecord from 'data/records/userRecord';
    import {
    	EMIT_USER,
    	GET_USER,
    	STORE_USER,
    	DEL_USER,
    	CLEAR_ALL
    } from '../userActionTypes';
    import User from '../schemas/userDbSchema';
    
    const realmSettings = {
    	schema: [User],
    	schemaVersion: 1,
    	migration: (oldRealm, newRealm) => {
    		// only apply this change if upgrading to schemaVersion 1
    		/* if (oldRealm.schemaVersion < 1) {
              const oldObjects = oldRealm.objects('User');
              const newObjects = newRealm.objects('User');
        
              // loop through all objects and set the name property in the new schema
              for (let i = 0; i < oldObjects.length; i++) {
                newObjects[i].sessionToken = undefined;
              }
            } */
    	}
    };
    
    const realm = new Realm(realmSettings);
    
    export function getUser() {
    	return {
    		type: GET_USER
    	};
    }
    
    export function emitUser(user) {
    	return {
    		type: EMIT_USER,
    		user
    	};
    }
    
    export function loadUser(userId) {
    	return async (dispatch, getState) => {
    		dispatch(getUser());
    
    		const sessionUser = getState().users.sessionUser;
    
    		if (sessionUser && sessionUser.id === userId) return sessionUser;
    
    		let user = null;
    
    		if (userId) user = realm.objectForPrimaryKey('User', userId);
    		else {
    			const users = realm.objects('User');
    
    			if (users.length > 0) user = users.values().next().value;
    		}
    
    		dbg(user ? `User ${user.id} loaded` : 'No user loaded');
    
    		if (user) {
    			dispatch(emitUser(new UserRecord(user)));
    
    			return user;
    		}
    
    		return null;
    	};
    }
    

    Version of Realm and Tooling

    • Realm JS SDK Version: 2.0.11
    • Node or React Native: React Native 0.49.5
    • Client OS & Version: Mac Os
    • Which debugger for React Native: React-Native-Debugger or Chrome
    T-Bug O-Community P-1-Required 
    opened by mschipperheyn 67
  • Accessing object of type X which has been invalidated or deleted

    Accessing object of type X which has been invalidated or deleted

    Even though the .isValid method is present in both collection and object, neither of them is doing anything to prevent this error.

    I tried using Collection.isValid, Object.isValid, Results.snapshot .. nothing works

    I'm rendering the Results on one view and if I delete one Object in another view and then return it throws this error.

    photo_2017-05-24_11-37-18

    here is my code for the 2 views

    import React, { Component } from 'react';
    import {
      InteractionManager
    } from 'react-native';
    import {
      Body,
      Button,
      Container,
      Content,
      Fab,
      Footer,
      FooterTab,
      Header,
      Icon,
      Input,
      Item,
      Left,
      List,
      ListItem,
      Right,
      Text,
      Title,
      View
    } from 'native-base';
    import realm from '../realm';
    
    class CharactersScreen extends Component {
    
      constructor (props) {
        super(props);
    
        this.characters = realm.objects('Character');
        this.state = {
          searchBar: {
            active: false
          },
          characters: this.characters
        };
      }
    
      navigateToAddCharacter = () => {
        let { navigate } = this.props.navigation;
    
        navigate('AddCharacter');
      }
    
      static navigationOptions = {
        title: 'Characters',
        headerRight: <View style={{ flexDirection: 'row' }}>
          <Button transparent><Icon name="md-search"/></Button>
          <Button transparent><Icon name="md-funnel"/></Button>
        </View>
      }
    
      listenToRealm = (name, changes) => {
        this.setState({
          characters: this.characters
        });
      }
    
      componentWillMount () {
        InteractionManager.runAfterInteractions(() => {
          this.characters.addListener(this.listenToRealm);
        });
      }
    
      componentWillUnmount () {
        this.characters.removeListener(this.listenToRealm);
      }
    
      render () {
        let { navigate } = this.props.navigation;
        let {
          searchBar,
          characters
        } = this.state;
    
        return (
          <Container>
            {
              searchBar.active ?
                <Header searchBar rounded>
                  <Item>
                    <Icon name="md-search" />
                    <Input placeholder="Search" />
                    <Icon name="md-people" />
                  </Item>
                  <Button transparent>
                    <Text>Search</Text>
                  </Button>
                </Header> : null
            }
            <Content>
              <List>
                {
                  characters.map((character, index) => {
                    return (
                      <ListItem
                        key={index} onPress={navigate.bind(null, 'CharacterDetails', {
                          character
                        })}>
                        <Body>
                          <Text>{character.name}</Text>
                          <Text note>{character.note}</Text>
                        </Body>
                        <Right>
                          <Icon name="md-arrow-round-forward" />
                        </Right>
                      </ListItem>
                    );
                  })
                }
              </List>
            </Content>
            <Fab
              active={false}
              direction="top"
              containerStyle={{ marginLeft: 10 }}
              style={{ backgroundColor: '#5067FF' }}
              position="bottomRight"
              onPress={this.navigateToAddCharacter}>
                <Icon name="md-add" />
            </Fab>
          </Container>
        );
      }
    }
    
    export default CharactersScreen;
    
    

    Here is the view where I delete the object

    import React, { Component } from 'react';
    import {
      Alert
    } from 'react-native';
    import {
      Body,
      Button,
      Card,
      CardItem,
      Container,
      Content,
      Icon,
      Left,
      Right,
      Text
    } from 'native-base';
    import realm from '../realm';
    
    class CharacterDetailsScreen extends Component {
    
      static navigationOptions = {
        title: 'Character: Details'
      }
    
      promptDelete = () => {
        Alert.alert(
          'Delete Character',
          'Deleting is irreversible, are you sure?',
          [
            { text: 'Cancel', onPress: () => false },
            { text: 'OK', onPress: () => this.deleteCharacter() }
          ],
          { cancelable: false }
        );
      }
    
      deleteCharacter = () => {
        let {
          state: {
            params: {
              character
            }
          }
        } = this.props.navigation;
        let { goBack } = this.props.navigation;
    
        realm.write(() => {
          realm.delete(character);
        });
    
        goBack();
      }
    
      render () {
        let {
          navigate,
          state: {
            params: {
              character
            }
          }
        } = this.props.navigation;
    
        return (
          <Container>
            <Content>
              <Card>
                <CardItem header>
                  <Left>
                    <Icon name={character.favorite ? 'md-star' : 'md-person'}/>
                    <Body>
                      <Text>{character.name}</Text>
                      <Text note>{character.note}</Text>
                    </Body>
                  </Left>
                </CardItem>
                <CardItem>
                  <Body>
                    <Text>{character.description}</Text>
                  </Body>
                </CardItem>
                <CardItem>
                  <Body>
                    <Text>Status</Text>
                    <Text note>{character.status}</Text>
                  </Body>
                </CardItem>
                <CardItem>
                  <Left>
                    <Button onPress={this.promptDelete} transparent>
                      <Icon name="md-close" style={{ color: '#FF0000' }} />
                      <Text style={{ color: '#FF0000' }}> Delete</Text>
                    </Button>
                  </Left>
                  <Right>
                    <Button transparent>
                      <Icon name="md-create" />
                      <Text> Edit</Text>
                    </Button>
                  </Right>
                </CardItem>
              </Card>
            </Content>
          </Container>
        );
      }
    }
    
    export default CharacterDetailsScreen;
    
    
    T-Bug O-Community 
    opened by L3V147H4N 63
  • Stability issues with Realm v. 10.13.0 and 10.16.0

    Stability issues with Realm v. 10.13.0 and 10.16.0

    Since we upgraded Realm from 10.10.1 => 10.13.0, we have experienced a big drop in stability on iOS and have been hit by what appears to be native memory management issues. Our crash reporting tool (Bugsnag) reports that the iOS app session stability dropped from ~ 99% to ~ 90%. We didn't update any other dependencies (or made any native code changes) in the release where we updated Realm and started seeing these issues. This is what the top crashes looked like with Realm 10.13.0:

    app-with-realm-10.13.0

    Then we tried upgrading Realm from 10.13.0 => 10.16.0 (again without making changes to other app dependencies or making native code changes) but unfortunately the session stability did not improve. This is what the top crashes look like with Realm after the Realm upgrade to 10.16.0 (sorry about the non-symbolicated traces):

    app-with-realm-10.16.0

    Both app versions with Realm 10.13.0 and 10.16.0 show realm::NoSuchTable and realm::KeyNotFound crashes. However, the most frequently reported crash comes in the form of a more general SIGABRT error report which it's my understanding could be rooted in any native module. Here's an example stack trace from the reported SIGABRT crash:

    CrashReporter Key:  6d45566d1ac905693d54683d15c5898bf1c38050
    Hardware Model:     iPhone12,5
    Process:            driversnote
    Identifier:         com.driversnote.driversnote
    Version:            4.4.0
    Role:               Background
    OS Version:         iOS 15.4.1
    
    
    SIGABRT: 
    
    0   libsystem_kernel.dylib  ___pthread_kill
    1   libsystem_pthread.dylib _pthread_kill
    2   libsystem_c.dylib       _abort
    [...]
    21  JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlot(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&)
    22  JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlotByIndex(JSC::JSObject*, JSC::JSGlobalObject*, unsigned int, JSC::PropertySlot&)
    23  JavaScriptCore          _llint_slow_path_get_by_val
    24  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    25  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    26  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    27  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    28  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    29  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    30  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    31  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    32  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    33  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    34  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    35  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    36  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    37  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    38  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    39  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    40  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    41  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    42  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    43  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    44  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    45  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    46  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    47  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    48  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    49  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    50  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    51  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    52  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    53  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    54  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    55  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    56  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    57  JavaScriptCore          _vmEntryToJavaScriptTrampoline
    58  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    59  JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
    60  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    61  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    62  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    63  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    64  JavaScriptCore          _vmEntryToJavaScriptTrampoline
    65  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    66  JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
    67  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    68  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    69  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    70  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    71  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    72  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    73  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    74  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    75  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    76  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    77  JavaScriptCore          _vmEntryToJavaScriptTrampoline
    78  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    79  JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
    80  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    81  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    82  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    83  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    84  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    85  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    86  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    87  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    88  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    89  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    90  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    91  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    92  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    93  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    94  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    95  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    96  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    97  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    98  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    99  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    100 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    101 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    102 JavaScriptCore          _vmEntryToJavaScriptTrampoline
    103 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    104 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
    105 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
    106 JavaScriptCore          _vmEntryToJavaScriptTrampoline
    107 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    108 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
    109 JavaScriptCore          _vmEntryToNative
    110 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    111 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
    112 JavaScriptCore          _JSObjectCallAsFunction
    [...]
    119 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
    120 CoreFoundation          ___CFRunLoopDoBlocks
    121 CoreFoundation          ___CFRunLoopRun
    122 CoreFoundation          _CFRunLoopRunSpecific
    123 driversnote             0x100339374 (0x100339270 + 260) (driversnote)
    124 Foundation              ___NSThread__start__
    125 libsystem_pthread.dylib __pthread_start
    

    Here are a few crash reports retrieved through XCode which mention Realm in the stack trace - they are all from the app version which uses realm v. 10.16.0: 2022-04-23_11-24-19.2673_-0500-2fd0a5349d21e8624bedea7cadd05249a7ef257e.txt 2022-04-24_09-49-16.5911_+0800-5d54e08447eada3d190a81ad0583993fbed9e685.txt 2022-04-24_11-06-35.7773_+0800-1dc9a5cb656aa8f4597272dea4f4e2fd2fe4b7d3.txt 2022-04-24_11-51-44.3257_-0500-e80fd319087391b20fa73e248a7f66e80b34afa0.txt 2022-04-24_13-26-48.1968_+0200-00cc3ee3534c38956fa8190f226d1dd5d1a04af5.txt 2022-04-25_10-50-14.0976_+0200-10370900cb31f02fbe46c189a186c85709ec1532.txt

    We realise that this issue is somewhat vague but unfortunately we haven't yet found a way to reproduce the crashes. Our hope is that some of the attached crash reports will be meaningful for the Realm team and either point to a Realm problem - or to something which we could be doing wrong but which only causes problems in these new realm versions.

    We use Realm with react-native v. 0.65.2 (without Hermes)

    T-Bug T-Bug-Crash O-Community 
    opened by martinpoulsen 55
  • Missing Realm constructor. Did you run

    Missing Realm constructor. Did you run "react-native link realm"?

    2019-10-12 18:12:48.003275+0800 mlmlApp[28520:193898] [] nw_socket_handle_socket_event [C5.1:1] Socket SO_ERROR [61: Connection refused] 2019-10-12 18:12:48.008963+0800 mlmlApp[28520:193898] [] nw_socket_handle_socket_event [C5.2:1] Socket SO_ERROR [61: Connection refused] 2019-10-12 18:12:48.017092+0800 mlmlApp[28520:193888] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection 2019-10-12 18:12:48.017465+0800 mlmlApp[28520:193888] TCP Conn 0x6000020f1680 Failed : error 0:61 [61] 2019-10-12 18:12:48.222 [error][tid:com.facebook.react.JavaScript] Error: Missing Realm constructor. Did you run "react-native link realm"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting 2019-10-12 18:12:48.226 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Error: Missing Realm constructor. Did you run "react-native link realm"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting 2019-10-12 18:12:48.253 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) 2019-10-12 18:12:48.256 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

    Version of Realm and Tooling

    • Realm JS SDK Version: 3.2.0
    • Node or React Native: 0.61.2
    • Client OS & Version: Mac10.14.6
    • Which debugger for React Native: xCode

    I have followed the documentation ‘https://realm.io/docs/javascript/latest/#missing-realm-constructor’ but it not work

    T-Enhancement O-Community 
    opened by Yieron 55
  •  /lib/arm64/librealmreact.so Crashes on app launch

    /lib/arm64/librealmreact.so Crashes on app launch

    Goals

    Expected Results

    Actual Results

    [18:48] Jaideep Singh (Contractor)

    Build fingerprint: 'samsung/hero2ltexx/hero2lte:8.0.0/R16NW/G935FXXU2ERGE:user/release-keys'

    Revision: '9'

    ABI: 'arm64'

    pid: 21491, tid: 21588, name: mqt_js >>> <<<

    signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x37bf3a90253f5

    x0 0000000000000000 x1 0000000000000000 x2 0000000000000005 x3 a9037bf3a90253f5

    x4 0000000000000040 x5 0000007329905788 x6 0000000000ffffff x7 ffffffffffffffff

    x8 00000000000000e2 x9 a0e2bc1e8f6365e0 x10 0000000000000001 x11 0000000000000000

    x12 0000007337fbb2c8 x13 0000000000000050 x14 000000000000000d x15 aaaaaaaaaaaaaaab

    x16 000000732a38c710 x17 000000733a046cb0 x18 0000007329905a84 x19 0000007337e6f690

    x20 0000007337e6f690 x21 00000073299057b8 x22 0000007329905828 x23 0000007329907588x24 000000733baecbc8 x25 0000007329907588 x26 0000000000000000 x27 0000000000000000

    x28 0000000000000001 x29 0000007329905660 x30 0000007329c65e84

    sp 0000007329905600 pc 00037bf3a90253f5 pstate 0000000060000000

    backtrace:

    #00 pc 00037bf3a90253f5

    #01 pc 0000000000258e80 /lib/arm64/librealmreact.so

    #02 pc 0000000000022414 /lib/arm64/libjscexecutor.so (_ZN8facebook3jsc10JSCRuntimeC2Ev+28)

    #03 pc 00000000000254d0 /lib/arm64/libjscexecutor.so (_ZN8facebook3jsc14makeJSCRuntimeEv+28)

    #04 pc 0000000000018b58 /lib/arm64/libjscexecutor.so

    #05 pc 00000000000a4468 /lib/arm64/libreactnativejni.so (_ZN8facebook5react16NativeToJsBridgeC2EPNS0_17JSExecutorFactoryENSt6__ndk110shared_ptrINS0_14ModuleRegistryEEENS5_INS0_18MessageQueueThreadEEENS5_INS0_16InstanceCallbackEEE+252)

    #06 pc 000000000009c0e0 /lib/arm64/libreactnativejni.so

    #07 pc 0000000000065d7c ==/lib/arm64/libreactnativejni.so

    #08 pc 0000000000063cac /lib/arm64/libreactnativejni.so

    #09 pc 0000000000059288 /lib/arm64/libreactnativejni.so (_ZN8facebook3jni6detail13MethodWrapperIMNS_5react15JNativeRunnableEFvvEXadL_ZNS4_3runEvEES4_vJEE8dispatchENS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassIS4_NS3_8RunnableEE8JavaPartESB_vE11_javaobjectEEE+32)

    #10 pc 0000000000059204 /lib/arm64/libreactnativejni.so (_ZN8facebook3jni6detail15FunctionWrapperIPFvNS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassINS_5react15JNativeRunnableENS6_8RunnableEE8JavaPartES8_vE11_javaobjectEEEEXadL_ZNS1_13MethodWrapperIMS7_FvvEXadL_ZNS7_3runEvEES7_vJEE8dispatchESE_EESD_vJEE4callEP7_JNIEnvP8_jobject+56) #11 pc 000000000007a63c /oat/arm64/base.odex (offset 0x75000)

    Steps to Reproduce

    Launching the app

    Code Sample

    defaultConfig { applicationId "package-name" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 137 versionName "8.2" multiDexEnabled true ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' // Added } vectorDrawables.useSupportLibrary = true resValue "string", "build_config_package", "package-name" if (BUILD_FOR_APPCENTER=='false') { signingConfig signingConfigs.release } }

    Version of Realm and Tooling

    • Realm JS SDK Version: 2.28.0
    • Node or React Native: ^0.59.4
    • Client OS & Version: Android 8
    • Which debugger for React Native: ?/None
    T-Bug-Crash O-Community 
    opened by jaideep101 52
  • Failed to load 'http://<DEVICEIP>:8083/create_session'

    Failed to load 'http://:8083/create_session'

    Goals

    Identify and fix bug. Debug JS Remotely worked fine before adding Realm.

    Expected Results

    Not crash the app and still be able to Debug JS Remotely.

    Actual Results

    Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8083/create_session'.

    Steps to Reproduce

    react-native init AwesomeProject yarn add realm Added "import Realm from 'realm';" to App.js react-native link realm

    Install and run app on iOS device. Enable Debug JS Remotely.

    Version of Realm and Tooling

    • Realm JS SDK Version: 2.4.1
    • Node or React Native: 0.54
    • Client OS & Version: iOS 11.3.1
    • Which debugger for React Native: Chrome 66.0.3359.139
    T-Enhancement First-Good-Issue O-Community 
    opened by nitelight 49
  • 10.20.0-beta.5 Missing Constructor Error

    10.20.0-beta.5 Missing Constructor Error

    How frequently does the bug occur?

    All the time

    Description

    I did a clean install of version [email protected] to test if it would work with reanimated2. But from the beginning I got the "Missing Realm constructor" error message.

    Im using:

        "expo": "~45.0.0",
        "expo-dev-client": "~0.9.6",
        "expo-splash-screen": "~0.15.1",
        "expo-status-bar": "~1.3.0",
        "react": "17.0.2",
        "react-dom": "17.0.2",
        "react-native": "0.68.2",
        "react-native-web": "0.17.7",
        "realm": "10.20.0-beta.5"```
    
    ### Stacktrace & log output
    
    ```shell
    Error: Missing Realm constructor. Did you run "pod install"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:4 in reportException
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
    at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
    at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
    at node_modules/metro-runtime/src/polyfills/require.js:203:6 in guardedLoadModule
    at http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.realmexpo&modulesOnly=false&runModule=true:142813:3 in global code
    
    Invariant Violation: "main" has not been registered. This can happen if:
    * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
    * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:4 in reportException
    at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException
    at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
    at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
    

    Can you reproduce the bug?

    Yes, always

    Reproduction Steps

    You can use the repo below as example and just configure a Sync App. https://github.com/djgoulart/realm-sync-error

    Version

    10.20.0-beta.5

    What SDK flavour are you using?

    Atlas App Services (auth, functions, etc.)

    Are you using encryption?

    No, not using encryption

    Platform OS and version(s)

    Android SDK 32

    Build environment

    Which debugger for React Native: ..

    Cocoapods version

    No response

    T-Bug Reproduction-Required O-Community 
    opened by djgoulart 46
  • Build Failed on iOS

    Build Failed on iOS

    Result

    Resolved requirements: { SYNC_SERVER_FOLDER: 'sync', SYNC_ARCHIVE: 'realm-sync-cocoa-3.0.0.tar.gz', SYNC_ARCHIVE_ROOT: 'core' } No lockfile found at the target, proceeding. Download url: https://static.realm.io/downloads/sync/realm-sync-cocoa-3.0.0.tar.gz Extracting realm-sync-cocoa-3.0.0.tar.gz => /Users/pong/Projects/infopais-mobile/node_modules/realm/vendor/realm-ios { Error: unexpected end of file at Zlib._handle.onerror (zlib.js:371:17) errno: -5, code: 'Z_BUF_ERROR' } Command /bin/sh failed with exit code 1

    Steps to Reproduce

    react-native init Test yarn add realm react-native link realm react-native run-ios

    Version of Realm and Tooling

    • Realm JS SDK Version: 2.3.0
    • Node or React Native: React Native - 0.55
    • Client OS & Version: macOS High Sierra
    • Which debugger for React Native: ?/None

    Issue is same with #1647, but after removing and installing after many times. Still getting error

    T-Help O-Community 
    opened by krrevilla 46
  • [hermes] Realm.open throws error when checking if Realm exists

    [hermes] Realm.open throws error when checking if Realm exists

    How frequently does the bug occur?

    Always

    Description

    When trying to open Realm, it throws error

    Error: Exception in HostFunction: 'onDiscard' is required
        at exists (native)
        at open (http://192.168.0.58:8081/index.freeyourmusic.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=io.stampapp.Stamp:297173:50)
    

    on this line (bundled file thus the screenshot): CleanShot 2023-01-09 at 15 55 24@2x

    The config which we open the Realm with: CleanShot 2023-01-09 at 16 01 20@2x

    • JSON serialized:
    {
      "schema": [],
      "sync": {
        "user": {},
        "partitionValue": "d7297249-7b94-405c-92f9-163effecc6ad",
        "existingRealmFileBehavior": {
          "type": "openImmediately"
        },
        "newRealmFileBehavior": {
          "type": "openImmediately"
        },
        "clientReset": {}
      }
    }
    

    I have cut out the schema part as it was too long.

    I have tracked it to this line of code https://github.com/realm/realm-js/blob/master/src/js_sync.hpp#L1308 But I cannot find any documentation about it: https://www.mongodb.com/docs/realm/sdk/node/examples/reset-a-client-realm/ There is neither mention of onDiscard nor onRecovery.

    Stacktrace & log output

    No response

    Can you reproduce the bug?

    No

    Reproduction Steps

    No response

    Version

    11.3.0

    What services are you using?

    Atlas Device Sync

    Are you using encryption?

    No

    Platform OS and version(s)

    iOS 16.0.3 / React Native 0.70.6

    Build environment

    Which debugger for React Native: Flipper (hermes)

    Cocoapods version

    No response

    T-Bug O-Community 
    opened by bimusiek 1
  • Revisiting bindgen Metro config (+ re-enabling performance tests)

    Revisiting bindgen Metro config (+ re-enabling performance tests)

    What, How & Why?

    This PR reverts part of https://github.com/realm/realm-js/pull/5194 in favour of a simpler Metro config which successfully runs the tests (including the performance tests). We might need to add additional directories to the watch folders or use the nodeModulesPaths option in the future.

    ☑️ ToDos

    • [ ] 📝 Changelog entry
    • [x] 📝 Compatibility label is updated or copied from previous entry
    • [x] 📝 Update COMPATIBILITY.md
    • [x] 🚦 Tests (manually in combination with other changes on a different branch)
    • [x] 🔀 Executed flexible sync tests locally if modifying flexible sync
    • [x] 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
    • [x ] 📱 Check the React Native/other sample apps work if necessary
    • [x] 📝 Public documentation PR created or is not necessary
    • [x] 💥 Breaking label has been applied or is not necessary
    T-Internal cla: yes 
    opened by kraenhansen 0
  • Type-safe queries

    Type-safe queries

    Problem

    TypeScript users would like to be able to rely on their types when querying the database for objects.

    Solution

    A former member of the team has been experimenting with this already: https://github.com/tomduncalf/babel-realm-typesafe-plugin

    Any feedback on ☝️ or ideas on the ideal API would be highly appreciated.

    How important is this improvement for you?

    Would be a major improvement

    T-Enhancement 
    opened by kraenhansen 0
  • Unhandled JS Exception: Error: Missing Realm constructor. Did you run

    Unhandled JS Exception: Error: Missing Realm constructor. Did you run "pod install"?

    How frequently does the bug occur?

    Sometimes

    Description

    This crash happens with every new install on a device and the app crashes within 1 sec.

    RealmJS version : 10.24.0 Pod version: 10.32.1

    Stacktrace & log output

    # Crashlytics - Stack trace
    # Platform: apple
    # Version: 15.3.1 (217)
    # Issue: b4a8529b73bff444c4a586261c7544ea
    # Session: fc80e1b3d501496ab519955cc8b3a55f_DNE_0_v2
    # Date: Mon Jan 09 2023 17:20:37 GMT+0530 (India Standard Time)
    
    Fatal Exception: RCTFatalException: Unhandled JS Exception: Error: Missing Realm constructor. Did you run "pod install"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting
    0  CoreFoundation                 0x9e88 __exceptionPreprocess
    1  libobjc.A.dylib                0x178d8 objc_exception_throw
    2  appname                          0x1c0838 RCTFormatError + 166 (RCTAssert.m:166)
    3  appname                          0x231b00 -[RCTExceptionsManager reportFatal:stack:exceptionId:] + 68 (RCTExceptionsManager.mm:68)
    4  appname                          0x2322ec -[RCTExceptionsManager reportException:] + 135 (RCTExceptionsManager.mm:135)
    5  CoreFoundation                 0x74704 __invoking___
    6  CoreFoundation                 0x20b6c -[NSInvocation invoke]
    7  CoreFoundation                 0x20584 -[NSInvocation invokeWithTarget:]
    8  appname                          0x1ee5a0 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 587 (RCTModuleMethod.mm:587)
    9  appname                          0x1f0718 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 183 (RCTNativeModule.mm:183)
    10 appname                          0x1f03a0 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 419 (Optional.h:419)
    11 libdispatch.dylib              0x24b4 _dispatch_call_block_and_release
    12 libdispatch.dylib              0x3fdc _dispatch_client_callout
    13 libdispatch.dylib              0xb694 _dispatch_lane_serial_drain
    14 libdispatch.dylib              0xc1e0 _dispatch_lane_invoke
    15 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread
    16 libsystem_pthread.dylib        0xdf8 _pthread_wqthread
    17 libsystem_pthread.dylib        0xb98 start_wqthread
    
    com.apple.main-thread
    0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
    1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
    2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
    3  libsystem_kernel.dylib         0x108c mach_msg + 24
    4  CoreFoundation                 0x7aaf0 __CFRunLoopServiceMachPort + 160
    5  CoreFoundation                 0x7bd34 __CFRunLoopRun + 1232
    6  CoreFoundation                 0x80ed4 CFRunLoopRunSpecific + 612
    7  GraphicsServices               0x1368 GSEventRunModal + 164
    8  UIKitCore                      0x3a23d0 -[UIApplication _run] + 888
    9  UIKitCore                      0x3a2034 UIApplicationMain + 340
    10 appname                          0x39d3c main + 16 (main.m:16)
    11 ???                            0x1b08ec960 (Missing)
    
    Thread
    0  libsystem_kernel.dylib         0x1050 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
    2  libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    Thread
    0  libsystem_kernel.dylib         0x1050 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
    2  libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    Thread
    0  libsystem_kernel.dylib         0x1050 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
    2  libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    Thread
    0  libsystem_kernel.dylib         0x1050 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
    2  libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    Thread
    0  libsystem_kernel.dylib         0x1050 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
    2  libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    Crashed: com.google.firebase.crashlytics.ios.exception
    0  appname                          0x9c284 FIRCLSProcessRecordAllThreads + 393 (FIRCLSProcess.c:393)
    1  appname                          0x9c664 FIRCLSProcessRecordAllThreads + 424 (FIRCLSProcess.c:424)
    2  appname                          0x93cd0 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
    3  appname                          0x8ec70 __FIRCLSExceptionRecord_block_invoke + 232 (FIRCLSException.mm:232)
    4  libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
    5  libdispatch.dylib              0x13574 _dispatch_lane_barrier_sync_invoke_and_complete + 56
    6  appname                          0x8dc7c FIRCLSExceptionRecord + 234 (FIRCLSException.mm:234)
    7  appname                          0x8e790 FIRCLSExceptionRecordNSException + 126 (FIRCLSException.mm:126)
    8  appname                          0x8d8d4 FIRCLSTerminateHandler() + 398 (FIRCLSException.mm:398)
    9  libc++abi.dylib                0x10f28 std::__terminate(void (*)()) + 20
    10 libc++abi.dylib                0x10ec4 std::terminate() + 56
    11 libobjc.A.dylib                0x33bec objc_terminate + 16
    12 libdispatch.dylib              0x3ff0 _dispatch_client_callout + 40
    13 libdispatch.dylib              0xb694 _dispatch_lane_serial_drain + 672
    14 libdispatch.dylib              0xc1e0 _dispatch_lane_invoke + 384
    15 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
    16 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
    17 libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    Thread
    0  libsystem_kernel.dylib         0x1050 __workq_kernreturn + 8
    1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
    2  libsystem_pthread.dylib        0xb98 start_wqthread + 8
    
    com.apple.uikit.eventfetch-thread
    0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
    1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
    2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
    3  libsystem_kernel.dylib         0x108c mach_msg + 24
    4  CoreFoundation                 0x7aaf0 __CFRunLoopServiceMachPort + 160
    5  CoreFoundation                 0x7bd34 __CFRunLoopRun + 1232
    6  CoreFoundation                 0x80ed4 CFRunLoopRunSpecific + 612
    7  Foundation                     0x42334 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
    8  Foundation                     0x4221c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
    9  UIKitCore                      0x4d733c -[UIEventFetcher threadMain] + 436
    10 Foundation                     0x5b808 __NSThread__start__ + 716
    11 libsystem_pthread.dylib        0x16cc _pthread_start + 148
    12 libsystem_pthread.dylib        0xba4 thread_start + 8
    
    com.google.firebase.crashlytics.MachExceptionServer
    0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
    1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
    2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
    3  libsystem_kernel.dylib         0x108c mach_msg + 24
    4  appname                          0x961b8 FIRCLSMachExceptionServer + 192 (FIRCLSMachException.c:192)
    5  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    6  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    com.facebook.react.JavaScript
    0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
    1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
    2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
    3  libsystem_kernel.dylib         0x108c mach_msg + 24
    4  CoreFoundation                 0x7aaf0 __CFRunLoopServiceMachPort + 160
    5  CoreFoundation                 0x7bd34 __CFRunLoopRun + 1232
    6  CoreFoundation                 0x80ed4 CFRunLoopRunSpecific + 612
    7  appname                          0x1d1d00 +[RCTCxxBridge runRunLoop] + 378 (RCTCxxBridge.mm:378)
    8  Foundation                     0x5b808 __NSThread__start__ + 716
    9  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    10 libsystem_pthread.dylib        0xba4 thread_start + 8
    
    JavaScriptCore libpas scavenger
    0  libsystem_kernel.dylib         0x141c __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
    2  JavaScriptCore                 0xf6324 scavenger_thread_main + 1164
    3  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    4  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    Heap Helper Thread
    0  libsystem_kernel.dylib         0x141c __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
    2  JavaScriptCore                 0x4c6a4 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1808
    3  JavaScriptCore                 0xd0fc bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 304
    4  JavaScriptCore                 0xd578 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 248
    5  JavaScriptCore                 0x6ee5c WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352
    6  JavaScriptCore                 0x710e4 WTF::wtfThreadEntryPoint(void*) + 16
    7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    8  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    Heap Helper Thread
    0  libsystem_kernel.dylib         0x141c __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
    2  JavaScriptCore                 0x4c6a4 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1808
    3  JavaScriptCore                 0xd0fc bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 304
    4  JavaScriptCore                 0xd578 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 248
    5  JavaScriptCore                 0x6ee5c WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352
    6  JavaScriptCore                 0x710e4 WTF::wtfThreadEntryPoint(void*) + 16
    7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    8  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    Heap Helper Thread
    0  libsystem_kernel.dylib         0x141c __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
    2  JavaScriptCore                 0x4c6a4 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1808
    3  JavaScriptCore                 0xd0fc bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 304
    4  JavaScriptCore                 0xd578 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 248
    5  JavaScriptCore                 0x6ee5c WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352
    6  JavaScriptCore                 0x710e4 WTF::wtfThreadEntryPoint(void*) + 16
    7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    8  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    Heap Helper Thread
    0  libsystem_kernel.dylib         0x141c __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
    2  JavaScriptCore                 0x4c6a4 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1808
    3  JavaScriptCore                 0xd0fc bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 304
    4  JavaScriptCore                 0xd578 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 248
    5  JavaScriptCore                 0x6ee5c WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352
    6  JavaScriptCore                 0x710e4 WTF::wtfThreadEntryPoint(void*) + 16
    7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    8  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    Heap Helper Thread
    0  libsystem_kernel.dylib         0x141c __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
    2  JavaScriptCore                 0x4c6a4 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1808
    3  JavaScriptCore                 0xd0fc bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 304
    4  JavaScriptCore                 0xd578 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 248
    5  JavaScriptCore                 0x6ee5c WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352
    6  JavaScriptCore                 0x710e4 WTF::wtfThreadEntryPoint(void*) + 16
    7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    8  libsystem_pthread.dylib        0xba4 thread_start + 8
    
    com.apple.CoreMotion.MotionThread
    0  libsystem_kernel.dylib         0xb48 mach_msg2_trap + 8
    1  libsystem_kernel.dylib         0x13008 mach_msg2_internal + 80
    2  libsystem_kernel.dylib         0x13248 mach_msg_overwrite + 388
    3  libsystem_kernel.dylib         0x108c mach_msg + 24
    4  CoreFoundation                 0x7aaf0 __CFRunLoopServiceMachPort + 160
    5  CoreFoundation                 0x7bd34 __CFRunLoopRun + 1232
    6  CoreFoundation                 0x80ed4 CFRunLoopRunSpecific + 612
    7  CoreFoundation                 0xc4d04 CFRunLoopRun + 64
    8  CoreMotion                     0x13ec0 CLMotionActivity::isTypeInVehicle(CLMotionActivity::Type) + 22820
    9  libsystem_pthread.dylib        0x16cc _pthread_start + 148
    10 libsystem_pthread.dylib        0xba4 thread_start + 8
    

    Can you reproduce the bug?

    Sometimes

    Reproduction Steps

    No response

    Version

    10.24.0

    What services are you using?

    Local Database only

    Are you using encryption?

    No

    Platform OS and version(s)

    13+

    Build environment

    I am not able to reproduce this issue on my dev environment, but this is happening with users in production environment

    Cocoapods version

    10.32.1

    T-Bug O-Community 
    opened by SyedSaifAli 0
  • Expired tokens don't refresh before a 401 error in @realm/react

    Expired tokens don't refresh before a 401 error in @realm/react

    How frequently does the bug occur?

    Always

    Description

    We're using @realm/react in a React Native project and occasionally get 401 errors saying the user token has expired when making GraphQL requests. Subsequent requests appear to work.

    Previously, I used the refreshToken process outlined here: https://www.mongodb.com/docs/realm/web/graphql-apollo-react/#refresh-access-tokens However, I don't see the refreshToken method available on the @realm/react useUser object. Instead it is a string.

    Stacktrace & log output

    [Error: Response not successful: Received status code 401]
    

    Can you reproduce the bug?

    Always

    Reproduction Steps

    Bring the app to the foreground after the user token has expired and the first request throws the 401 error, despite being wrapped inside of the Realm provider with an authenticated user logged in.

    Version

    @realm/[email protected]

    What services are you using?

    Atlas Device Sync

    Are you using encryption?

    No

    Platform OS and version(s)

    iOS 16.1.2 (20B110)

    Build environment

    Which debugger for React Native: ..

    Cocoapods version

    RealmJS (11.2.0)

    T-Bug O-Community Waiting-For-Reporter 
    opened by greenafrican 1
  • Babel plugin does not recognise TypeScript

    Babel plugin does not recognise TypeScript "constant-named properties" for the @index decorator

    How frequently does the bug occur?

    All the time

    Description

    I want to declare my realm object class properties as constant-named properties so I can reuse the constants in queries. (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#constant-named-properties)

    There was an Unexpected token error on the property with @index.

    EDIT: the Babel plugin also does NOT add properties to the schema for constant-named properties.

    e.g.

    const PropertyNames = {
      MyIdGuid: 'myIdGuid',
      LastModifiedTimestamp: 'lastModifiedTimestamp'
    } as const;
    
    export class MyRealmObject extends Realm.Object<MyRealmObject> {
    
      // This works EDIT:   BUT the property does NOT get added to the generated schema
      [PropertyNames.MyIdGuid]!: Realm.BSON.UUID;
    
      // **** This does NOT work - TransformError SyntaxError:  'Unexpected token' error - at the location of the colon ****
      @index
      [PropertyNames.LastModifiedTimestamp]!: Date;
      
      // This does work
      @index
      lastModifiedTimestamp!: Date;
    
      ...
    

    Stacktrace & log output

    There is a `TransformError SyntaxError:` `Unexpected token` error - at the location of the colon
    
    
      @index
      [PropertyNames.LastModifiedTimestamp]!: Date;
    
    
    
    ### Can you reproduce the bug?
    
    Yes, always
    
    ### Reproduction Steps
    
    See code in Description
    
    ### Version
    
    Babel plugin 0.1.1
    
    ### What SDK flavour are you using?
    
    Local Database only
    
    ### Are you using encryption?
    
    No, not using encryption
    
    ### Platform OS and version(s)
    
    Android 11 R API 30 - Pixel 5 emulator
    
    ### Build environment
    
    Which debugger for React Native: ..
    
    
    ### Cocoapods version
    
    _No response_
    T-Bug O-Community 
    opened by channeladam 8
Releases(v11.3.1)
  • v11.3.1(Dec 7, 2022)

    Fixed

    • Not possible to open an encrypted file on a device with a page size bigger than the one on which the file was produced. (#8030, since v11.1.0)
    • Empty binary values will no longer be treated as null (#5114, since v10.5.0)

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v13.0.0.
    • File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v13.1.0 to v13.1.1. (#5154)
    Source code(tar.gz)
    Source code(zip)
  • babel-plugin-v0.1.1(Dec 6, 2022)

  • v11.3.0(Nov 25, 2022)

    Notes

    • The changelog entry for this release includes both v11.3.0-rc.0 and v11.3.0-rc.1.
    • File format version bumped. If Realm file contains any objects with set of mixed or dictionary properties, the file will go through an upgrade process.
    • The layout of the lock-file has changed, the lock file format version is bumped and all participants in a multiprocess scenario needs to be up to date so they expect the same format. (realm/realm-core#5440)
    • In order to open Realm files in Realm Studio, you are required to upgrade to Realm Studio v13.0.0 or later.

    Enhancements

    • The choice of a faster linker will now automatically be propagated to anything that statically links against Realm Core. (realm/realm-core#6043)
    • The realm file will be shrunk if the larger file size is no longer needed. (realm/realm-core#5754)
    • Most of the file growth caused by version pinning is eliminated. (realm/realm-core#5440)
    • A set of mixed consider string and binary data equivalent. This could cause the client to be inconsistent with the server if a string and some binary data with equivalent content was inserted from Atlas. (realm/realm-core#4860, since v10.5.0)

    Fixed

    • Fetching a user's profile while the user logs out would result in an assertion failure. (realm/realm-core#5571, since v10.4.1)
    • Removed the .tmp_compaction_space file being left over after compacting a Realm on Windows. (#4526 and realm/realm-core#5997, since Windows support for compact was added)
    • Restore fallback to full barrier when F_BARRIERSYNC is not available on Apple platforms. (realm/realm-core#6033, since v11.2.0)

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v13.0.0.
    • File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.12.0 to v13.1.0. ([#5120](https://github.com/realm/realm-js/issues/5120 and #5128
    Source code(tar.gz)
    Source code(zip)
  • v11.3.0-rc.1(Nov 22, 2022)

    Enhancements

    • The choice of a faster linker will now automatically be propagated to anything that statically links against Realm Core. (realm/realm-core#6043)

    Fixed

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v13.0.0 to v13.1.0. (#5128
    Source code(tar.gz)
    Source code(zip)
  • v11.3.0-rc.0(Nov 20, 2022)

    Notes

    • File format version bumped. If Realm file contains any objects with set of mixed or dictionary properties, the file will go through an upgrade process.
    • The layout of the lock-file has changed, the lock file format version is bumped and all participants in a multiprocess scenario needs to be up to date so they expect the same format. (realm/realm-core#5440)
    • In order to open Realm files in Realm Studio, you are required to upgrade to Realm Studio v13.0.0 or later.

    Enhancements

    • The realm file will be shrunk if the larger file size is no longer needed. (realm/realm-core#5754)
    • Most of the file growth caused by version pinning is eliminated. (realm/realm-core#5440)
    • A set of mixed consider string and binary data equivalent. This could cause the client to be inconsistent with the server if a string and some binary data with equivalent content was inserted from Atlas. (realm/realm-core#4860, since v10.5.0)

    Fixed

    • Fetching a user's profile while the user logs out would result in an assertion failure. (realm/realm-core#5571, since v10.4.1)
    • Removed the .tmp_compaction_space file being left over after compacting a Realm on Windows. (#4526 and realm/realm-core#5997, since Windows support for compact was added)
    • Restore fallback to full barrier when F_BARRIERSYNC is not available on Apple platforms. (realm/realm-core#6033, since v11.2.0)

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v13.0.0.
    • File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.12.0 to v13.0.0. (#5120
    Source code(tar.gz)
    Source code(zip)
  • v11.2.0(Nov 12, 2022)

    Enhancements

    • Flexible sync will now wait for the server to have sent all pending history after a bootstrap before marking a subscription as Complete. (realm/realm-core#5795)

    Fixed

    • Fix database corruption and encryption issues on apple platforms. (#5076, since v10.12.0)
    • Sync bootstraps will not be applied in a single write transaction - they will be applied 1MB of changesets at a time. (realm/realm-core#5999, since v10.19.0).
    • Fix a race condition which could result in operation cancelled errors being delivered to Realm#open rather than the actual sync error which caused things to fail. (realm/realm-core#5968, v1.0.0).

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.11.0 to v12.12.0.
    • Binaries for Centos/RHEL 7 are included in released. (#5006, since v10.21.0)
    • Binaries for Linux/ARMv7 are included in released.
    Source code(tar.gz)
    Source code(zip)
  • v10.24.0(Nov 13, 2022)

    Enhancements

    • Flexible sync will now wait for the server to have sent all pending history after a bootstrap before marking a subscription as Complete. (realm/realm-core#5795)

    Fixed

    • Fix database corruption and encryption issues on apple platforms. (#5076, since v10.12.0)
    • Sync bootstraps will not be applied in a single write transaction - they will be applied 1MB of changesets at a time. (realm/realm-core#5999, since v10.19.0).
    • Fix a race condition which could result in operation cancelled errors being delivered to Realm#open rather than the actual sync error which caused things to fail. (realm/realm-core#5968, v1.0.0).

    Compatibility

    • React Native >= v0.64.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.11.0 to v12.12.0.
    Source code(tar.gz)
    Source code(zip)
  • realm-react-v0.4.1(Nov 4, 2022)

  • v11.1.0(Nov 1, 2022)

    Enhancements

    • Add support for using functions as default property values, in order to allow dynamic defaults #5001, #2393
    • All fields of a Realm.Object treated as optional by TypeScript when constructing a new class-based model, unless specified in the second type parameter #5000
    • If a sync client sends a message larger than 16 MB, the sync server will request a client reset. (realm/realm-core#5209)
    • Add two new modes to client reset: RecoverUnsyncedChanges and RecoverOrDiscardUnsyncedChanges. The two modes will recover local/unsynced changes with changes from the server if possible. If not possible, RecoverOrDiscardUnsyncedChanges will remove the local Realm file and download a fresh file from the server. The mode DiscardLocal is duplicated as DiscardUnsyncedChanges, and DiscardLocal is be removed in a future version. (#4135)

    Fixed

    • Fixed a use-after-free if the last external reference to an encrypted Realm was closed between when a client reset error was received and when the download of the new Realm began. (realm/realm-core#5949, since v10.20.0)
    • Opening an unencrypted file with an encryption key would sometimes report a misleading error message that indicated that the problem was something other than a decryption failure. (realm/realm-core#5915, since v1.0.0)
    • Fixed a rare deadlock which could occur when closing a synchronized Realm immediately after committing a write transaction when the sync worker thread has also just finished processing a changeset from the sync server. (realm/realm-core#5948)

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.9.0 to v12.11.0.
    Source code(tar.gz)
    Source code(zip)
  • v10.23.0(Nov 1, 2022)

    Enhancements

    • Improve performance of client reset with automatic recovery and converting top-level tables into embedded tables. (realm/realm-core#5897)
    • If a sync client sends a message larger than 16 MB, the sync server will request a client reset. (realm/realm-core#5209)
    • Add two new modes to client reset: RecoverUnsyncedChanges and RecoverOrDiscardUnsyncedChanges. The two modes will recover local/unsynced changes with changes from the server if possible. If not possible, RecoverOrDiscardUnsyncedChanges will remove the local Realm file and download a fresh file from the server. The mode DiscardLocal is duplicated as DiscardUnsyncedChanges, and DiscardLocal is be removed in a future version. (#4135)

    Fixed

    • Fixed a use-after-free if the last external reference to an encrypted Realm was closed between when a client reset error was received and when the download of the new Realm began. (realm/realm-core#5949, since v10.20.0)
    • Opening an unencrypted file with an encryption key would sometimes report a misleading error message that indicated that the problem was something other than a decryption failure. (realm/realm-core#5915, since v1.0.0)
    • Fixed a rare deadlock which could occur when closing a synchronized Realm immediately after committing a write transaction when the sync worker thread has also just finished processing a changeset from the sync server. (realm/realm-core#5948)

    Compatibility

    • React Native >= v0.64.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.9.0 to v12.11.0.
    Source code(tar.gz)
    Source code(zip)
  • v11.0.0(Oct 18, 2022)

    Notes

    Based on Realm JS v10.22.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.19.5).

    Breaking changes

    Removed APIs

    • Removed all code related to the legacy Chrome Debugger. Please use Flipper as debugger.

    The following deprecated methods have been removed:

    • Realm#automaticSyncConfiguration
    • Realm.Credentials#google with authCode parameter (use authObject)
    • The following should be replaced with Realm.Credentials#apiKey:
      • Realm.Credentials#serverApiKey
      • Realm.Credentials#userApiKey
    • The overload of Realm.Auth.EmailPasswordAuth methods, taking positional arguments instead of object arguments:
      • registerUser
    • Removed Realm.JsonSerializationReplacer. Use circular JSON serialization libraries such as @ungap/structured-clone and flatted for stringifying Realm entities that have circular structures. The Realm entities' toJSON method returns plain objects and arrays (with circular references if applicable) which makes them compatible with any serialization library that supports stringifying plain JavaScript types. (#4997)

    Now the only supported call signature of Realm.Auth.EmailPasswordAuth methods is using a single object argument:

    registerUser({ email, password });
    confirmUser({ token, tokenId });
    resendConfirmationEmail({ email });
    retryCustomConfirmation({ email });
    resetPassword({ token, tokenId, password });
    sendResetPasswordEmail({ email });
    callResetPasswordFunction({ email, password }, ...args);
    

    Renamed APIs

    • Renamed the RealmInsertionModel<T> type to Unmanaged<T> to simplify and highlight its usage.

    The following APIs have been renamed on the Realm:

    | Before | After | | ------ | ----- | | empty | isEmpty | | readOnlyisReadOnly |

    The following APIs have been renamed on the Realm.Config:

    | Before | After | | ------ | ----- | | migration | onMigration | | shouldCompactOnLaunchshouldCompact |

    The following APIs have been renamed on the Realm.SyncConfiguration:

    | Before | After | | ------ | ----- | | error | onError| | clientReset.clientResetBeforeclientReset.onBefore | | clientReset.clientResetAfter | clientReset.onAfter | | ssl.validateCallback | ssl.validateCertificates |

    • A typo was fixed in the SubscriptionsState enum, in which SubscriptionsState.Superseded now returns superseded in place of Superseded

    Here are examples of the use of the APIs after they've been renamed:

    // before
    Realm.open({ migration:() => {} })
    // after
    Realm.open({ onMigration:() => {} })
    
    // before
    Realm.open({
      sync: {
        shouldCompactOnLaunch: /* ... */
        error: /* ... */
        clientReset: {
          clientResetBefore: /* ... */
          clientResetAfter: /* ... */
        }
        ssl:{
          validateCallback: /* ... */
        }
      }
    })
    // after
    Realm.open({
      sync: {
        shouldCompact: /* ... */
        onError: /* ... */
        clientReset: {
          onBefore: /* ... */
          onAfter: /* ... */
        }
        ssl:{
          validateCertificates: /* ... */
        }
      }
    })
    

    Changed APIs

    • Model classes passed as schema to the Realm constructor must now extend Realm.Object and will no longer have their constructors called when pulling an object of that type from the database. Existing classes already extending Realm.Object now need to call the super constructor passing two arguments:
    • realm: The Realm to create the object in.
    • values: Values to pass to the realm.create call when creating the object in the database.
    • Realm#writeCopyTo now only accepts an output Realm configuration as a parameter.
    • When no object is found calling Realm#objectForPrimaryKey, null is returned instead of undefined,
    • Removed Object#_objectId, which is now replaced by Object#_objectKey
    • Unified the call signature of User#callFunction (#3733)
    • Replaced string unions with enums where it made sense:
    • Realm.App.Sync.Session#state is now SessionState.
    • Realm.App.Sync.Session#addProgressNotification now takes (direction: ProgressDirection, mode: ProgressMode, progressCallback: ProgressNotificationCallback).
    • "discardLocal" is now the default client reset mode. (#4382)

    This is an example of calling a function with the new signature of callFunction:

    user.callFunction("sum", 1, 2, 3); // Valid
    user.callFunction("sum", [1, 2, 3]); // Invalid
    user.functions.sum(1, 2, 3); // Still the recommended
    

    Enhancements

    • Adding support for Hermes on iOS & Android.
    • Class-based models (i.e. user defined classes extending Realm.Object and passed through the schema when opening a Realm), will now create object when their constructor is called.
    • Small improvement to performance by caching JSI property String object #4863
    • Small improvement to performance for toJSON which should make it useful for cases where a plain representations of Realm entities are needed, e.g. when inspecting them for debugging purposes through console.log(realmObj.toJSON()). (#4997)
    • Catching missing libjsi.so when loading the librealm.so and rethrowing a more meaningful error, instructing users to upgrade their version of React Native.

    Example of declaring a class-based model in TypeScript:

    class Person extends Realm.Object<Person> {
      name!: string;
    
      static schema = {
        name: "Person",
        properties: { name: "string" },
      };
    }
    
    const realm = new Realm({ schema: [Person] });
    realm.write(() => {
      const alice = new Person(realm, { name: "Alice" });
      // A Person { name: "Alice" } is now persisted in the database
      console.log("Hello " + alice.name);
    });
    

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Using Realm Core v12.9.0
    • Building from source from a package downloaded via NPM is no longer supported, since we removed src and vendor from the NPM bundle, to reduce size blow-up caused by files recently added to the sub-module. This will force end-users to checkout the Git repository from GitHub when building from source. (#4060)
    • Renamed the following internal packages:
      • @realm.io/common -> @realm/common
      • realm-network-transport -> @realm/network-transport
      • realm-app-importer -> @realm/app-importer
      • realm-example -> @realm/example
      • realm-electron-tests -> @realm/electron-tests
      • realm-node-tests -> @realm/node-tests
      • realm-react-native-tests -> @realm/react-native-tests
    Source code(tar.gz)
    Source code(zip)
  • realm-web-v2.0.0(Oct 18, 2022)

    Breaking Changes

    • Realm.Credentials#google with authCode parameter (use authObject)
    • The following should be replaced with Realm.Credentials#apiKey:
      • Realm.Credentials#serverApiKey
      • Realm.Credentials#userApiKey
    • The overload of Realm.Auth.EmailPasswordAuth methods, taking positional arguments instead of object arguments:
      • registerUser
      • confirmUser
      • resendConfirmationEmail
      • retryCustomConfirmation
      • resetPassword
      • sendResetPasswordEmail
      • callResetPasswordFunction

    Now the only supported call signature of Realm.Auth.EmailPasswordAuth methods is using a single object argument:

    registerUser({ email, password });
    confirmUser({ token, tokenId });
    resendConfirmationEmail({ email });
    retryCustomConfirmation({ email });
    resetPassword({ token, tokenId, password });
    sendResetPasswordEmail({ email });
    callResetPasswordFunction({ email, password }, ...args);
    

    Enhancements

    • None

    Fixed

    • None
    Source code(tar.gz)
    Source code(zip)
  • realm-react-v0.4.0(Oct 18, 2022)

    Enhancements

    Fixed

    • None

    Compatibility

    • React JS v11.0.0
    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v12.0.0.

    Internal

    • Update devDependencies for testing:
      • react v18.1.0
      • react-native v0.70.1
      • react-test-renderer v18.1.0
      • @testing-library/react-native v11.2.0
      • @testing-library/jest-native v4.0.13
    • Refactor tests to use updated testing-library
    Source code(tar.gz)
    Source code(zip)
  • babel-plugin-v0.1.0(Oct 18, 2022)

  • v10.22.0(Oct 17, 2022)

    Enhancements

    • Prioritize integration of local changes over remote changes. This shortens the time users may have to wait when committing local changes. Stop storing downloaded changesets in history. (realm/realm-core#5844)
    • Greatly improve the performance of sorting or distincting a Dictionary's keys or values. The most expensive operation is now performed O(log N) rather than O(N log N) times, and large Dictionaries can see upwards of 99% reduction in time to sort. (realm/realm-core#5166)
    • Cut the runtime of aggregate operations on large dictionaries in half. (realm/realm-core#5864)
    • Improve performance of aggregate operations on collections of objects by 2x to 10x. (realm/realm-core#5864)

    Fixed

    • If a case insensitive query searched for a string including an 4-byte UTF8 character, the program would crash. (realm/realm-core#5825, since v1.0.0)
    • Realm#writeCopyTo() doesn't support flexible sync, and an exception is thrown. (realm/realm-core#5798, since v10.10.0)
    • Asymmetric object types/classes cannot be used with partition-based sync, and an exception is thrown. (realm/realm-core#5691, since v10.19.0)
    • If you set a subscription on a link in flexible sync, the server would not know how to handle it. (realm/realm-core#5409, since v10.10.1)
    • Fixed type declarations for aggregation methods (min, max, sum, avg) to reflect implementation. (4994, since v2.0.0)

    Compatibility

    • React Native >= v0.64.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.6.0 to v12.9.0. (#4932 and #4983
    • Added ARM/Linux build guide.
    Source code(tar.gz)
    Source code(zip)
  • v11.0.0-rc.2(Sep 15, 2022)

    Breaking change

    • Removed deprecated positional arguments to Email/Password authentication functions
      • The following functions now only accept object arguments:
      Realm.Auth.EmailPasswordAuth.registerUser({email, password});
      Realm.Auth.EmailPasswordAuth.confirmUser({token, tokenId});
      Realm.Auth.EmailPasswordAuth.resendConfirmationEmail({email});
      Realm.Auth.EmailPasswordAuth.retryCustomConfirmation({email});
      Realm.Auth.EmailPasswordAuth.resetPassword({token, tokenId, password});
      Realm.Auth.EmailPasswordAuth.sendResetPasswordEmail({email});
      Realm.Auth.EmailPasswordAuth.callResetPasswordFunction({email, password}, ...args);
      
    • Unify the call signature documentation of User#callFunction (#3733)
      • Example:
      user.callFunction("sum", 1, 2, 3); // Valid
      user.callFunction("sum", [1, 2, 3]); // Invalid
      

    Enhancements

    • Small improvement to performance by caching JSI property String object #4863

    Compatibility

    • React Native >= v0.70.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).
    Source code(tar.gz)
    Source code(zip)
  • v10.21.1(Sep 15, 2022)

    Fixed

    • Fixed pinning of the NDK used to build our prebuilt binaries for Android. Our previous version, Realm JS v10.21.0 was compiled with NDK 25.1.8937393, which could result in unpredictable crashes, since this needs to match the one being used by React Native. ((#4910)[https://github.com/realm/realm-js/pull/4910], since v10.21.0)

    Compatibility

    • React Native >= v0.64.0
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).
    Source code(tar.gz)
    Source code(zip)
  • realm-react-v0.4.0-rc.0(Oct 18, 2022)

  • v10.21.0(Sep 12, 2022)

    Note: This release is missing a prebuilt binary for Linux arm64, please checkout the repository on GitHub and build from source if want to use the release on a Raspberry Pi.

    Enhancements

    • Automatic handling backlinks for schema migrations where a class/object type changes to being embedded. (realm/realm-core#5737)
    • Improve performance when a new Realm file connects to the server for the first time, especially when significant amounts of data has been written while offline.
    • Improve the performance of the sync changeset parser, which speeds up applying changesets from the server.

    Fixed

    • Fixed dangling pointer in binary datatype handling in Node (#3781, since v10.5.0)
    • Fixed undefined behaviour on queries involving a constant and an indexed property on some property types like UUID and Date. (realm/realm-core#5753, since v10.20.0)
    • Fixed an exception fcntl() with F_BARRIERFSYNC failed: Inappropriate ioctl for device when running with MacOS on an exFAT drive. (realm/realm-core#5789, since v10.18.0)
    • Syncing of a Decimal128 with big significand could result in a crash. (realm/realm-core#5728, since v10.0.0)
    • discardLocal client reset mode will now wait for flexible sync Realms to be fully synchronized before beginning recovery operations. (realm/realm-core#5705, since v10.11.0)

    Compatibility

    • React Native >= v0.64.0
    • MongoDB Realm Cloud.
    • Realm Studio v11.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.5.1 to v12.6.0. (#4865)
    • Updated C++ clang-format version to match newer MacOS default (#4869)
    Source code(tar.gz)
    Source code(zip)
  • v10.20.0(Aug 23, 2022)

    NOTE: This version is unrelated to the v10.20.0-alpha and v10.20.0-beta prereleases. Hermes is not supported by this release. If your app depends on one of the prereleases, you must upgrade to the v11.0.0-rc releases.

    Enhancements

    • Introducing query support for constant list expressions such as fruit IN {'apple', 'orange'}. This also includes general query support for list vs list matching such as NONE fruits IN {'apple', 'orange'}. (#2781 and #4596)
    • Allow multiple anonymous sessions. (realm/realm-core#4607)

    Fixed

    • Fixed issue where React Native apps on Android would sometimes show stale Realm data until the user interacted with the app UI. (#4389, since v10.0.0)
    • Reduced use of memory mappings and virtual address space. (realm/realm-core#5645)
    • Fixed a data race when committing a transaction while multiple threads are waiting for the write lock on platforms using emulated interprocess condition variables (most platforms other than non-Android Linux). (realm/realm-core#5643)
    • Fixed a data race when writing audit events which could occur if the sync client thread was busy with other work when the event Realm was opened. (realm/realm-core#5643)
    • Fixed some cases of running out of virtual address space (seen/reported as mmap failures). (realm/realm-core#5645)
    • Fixed the client reset callbacks not populating the Realm instance arguments correctly in some cases. (#5654, since v10.11.0)
    • Decimal128 values with more than 110 significant bits were not synchronized correctly with the server. (realm/realm-swift#7868, since v10.0.0)
    • Fixed an incorrect git merge in the Xcode project from RN iOS. (#4756, since v10.19.5)
    • Fixed detection of emulator environments to be more robust. Thanks to Ferry Kranenburg for identifying the issue and supplying a PR. (#4784)
    • Opening a read-only synced Realm for the first time could lead to m_schema_version != ObjectStore::NotVersioned assertion.

    Compatibility

    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Updated ccache build scripts to be location agnostic. (#4764)
    • Upgraded Realm Core from v12.3.0 to v12.5.1. ([#4753](https://github.com/realm/realm-js/issues/4753 and [#4763)
    • Upgraded React Native integration tests app to React Native v0.68.2. (#4583)
    • Upgrading react-native-fs to avoid a peer dependency failure. (#4709)
    • Upgraded React Native integration tests app to React Native v0.69.1. (#4713)
    • Upgraded Realm Example app to React Native v0.69.1. (#4722)
    • Fixed a crash on Android when an error was thrown from the flexible sync initialSubscriptions call. (#4710, since v10.18.0)
    • Added a default sync logger for integration tests. (#4730)
    • Fixed an issue starting the integration test runner on iOS. (#4742)
    • Fixed dark mode logo in README.md. (#4780)
    • Migrated to std::optional and std::nullopt.
    • Disabled testing on iOS and Catalyst on legacy CI system.
    Source code(tar.gz)
    Source code(zip)
    realm-v10.20.0-napi-v5-darwin-x64.tar.gz(3.05 MB)
    realm-v10.20.0-napi-v5-linux-x64.tar.gz(5.05 MB)
    realm-v10.20.0-napi-v5-win32-ia32.tar.gz(3.01 MB)
    realm-v10.20.0-napi-v5-win32-x64.tar.gz(3.46 MB)
  • realm-react-v0.3.2(Jul 14, 2022)

  • v11.0.0-rc.1(Jul 11, 2022)

    Notes

    This is primarily a re-release of 11.0.0-rc.0, which is compatible with React Native v0.69.0 or above. The release is based on Realm JS v10.19.5.

    Enhancements

    • None.

    Fixed

    • None.

    Compatibility

    • React Native equal to or above v0.69.0 and above, since we're shipping binaries pre-compiled against the JSI ABI.
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).
    Source code(tar.gz)
    Source code(zip)
  • v11.0.0-rc.0(Jul 7, 2022)

    Notes

    Based on Realm JS v10.19.5: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.17.0).

    Breaking change

    • Removed all code related to the legacy Chrome Debugger. Please use Flipper as debugger.
    • Model classes passed as schema to the Realm constructor must now extend Realm.Object and will no longer have their constructors called when pulling an object of that type from the database. Existing classes already extending Realm.Object now need to call the super constructor passing two arguments:
      • realm: The Realm to create the object in.
      • values: Values to pass to the realm.create call when creating the object in the database.
    • Renamed the RealmInsertionModel<T> type to Unmanaged<T> to simplify and highlight its usage.
    • Installing via NPM from a git:// URL is no longer supported, since we removed src and vendor from the NPM bundle, to reduce size blow-up caused by files recently added to the sub-module. This will force end-users to checkout the Git repository from GitHub when building from source. (#4060)

    Enhancements

    • Adding support for Hermes on iOS & Android.
    • Class-based models (i.e. user defined classes extending Realm.Object and passed through the schema when opening a Realm), will now create object when their constructor is called:
    class Person extends Realm.Object<Person> {
      name!: string;
    
      static schema = {
        name: "Person",
        properties: { name: "string" },
      };
    }
    
    const realm = new Realm({ schema: [Person] });
    realm.write(() => {
      const alice = new Person(realm, { name: "Alice" });
      // A Person { name: "Alice" } is now persisted in the database
      console.log("Hello " + alice.name);
    });
    

    Fixed

    Compatibility

    • React Native equal to or above v0.66.0 and below v0.69.0 (not included), since we're shipping binaries pre-compiled against the JSI ABI.
    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).
    Source code(tar.gz)
    Source code(zip)
  • v10.19.5(Jul 6, 2022)

    Enhancements

    • None.

    Fixed

    • Fixed inadvertent change to minimum Android Gradle plugin version (#4706, since v10.19.4)

    Compatibility

    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • None
    Source code(tar.gz)
    Source code(zip)
    realm-v10.19.5-napi-v5-darwin-x64.tar.gz(3.04 MB)
    realm-v10.19.5-napi-v5-linux-x64.tar.gz(5.02 MB)
    realm-v10.19.5-napi-v5-win32-ia32.tar.gz(3.01 MB)
    realm-v10.19.5-napi-v5-win32-x64.tar.gz(3.46 MB)
  • v10.19.4(Jul 5, 2022)

    Enhancements

    Fixed

    • Setting up a clientResetAfter callback could lead to a fatal error with the message Realm accessed from incorrect thread. (#4410, since v10.11.0)
    • Improved performance of sync clients during integration of changesets with many small strings (totalling > 1024 bytes per changeset) on iOS 14, and devices which have restrictive or fragmented memory. (realm/realm-core#5614)
    • Fixed a bug that prevented the detection of tables being changed to or from asymmetric during migrations. (realm/realm-core#5603, since v10.19.3)
    • Fixed a bug with handling null values in toJSON ([#4682, since 10.19.3)

    Compatibility

    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.2.0 to v12.3.0. (#4689)
    • Fixed analytics tests to reflect the fact that framework versions are read from node_modules, not package.json. (#4687)
    • Adding response type checking to the realm-app-importer. (#4688)
    • Updated integration test app to target Android SDK 31 (#4686)
    • Enabled debugging Realm C++ code in integration test app (#4696)
    • Fixed types for flexible sync client reset and added a test (#4702)
    Source code(tar.gz)
    Source code(zip)
  • realm-web-v1.7.1(Jul 4, 2022)

    Breaking Changes

    • None

    Enhancements

    • None

    Fixed

    • Fixed an issue where closing a watch stream, by calling return on the AsyncIterator, wouldn't propagate to closing the underlying network connection. (#4700)
    Source code(tar.gz)
    Source code(zip)
  • v10.19.3(Jun 27, 2022)

    Enhancements

    • None.

    Fixed

    • Realm JS can now be installed in environments using npm binary mirroring (#4672, since v10.0.0).
    • Asymmetric sync now works with embedded objects. (realm/realm-core#5565, since 10.19.0)
    • Fixed an issue on Windows that would cause high CPU usage by the sync client when there are no active sync sessions. (realm/realm-core#5591, since v1.1.1)
    • Fixed an issue setting a Mixed from an object to null or any other non-link value. Users may have seen exception of key not found or assertion failures such as mixed.hpp:165: [realm-core-12.1.0] Assertion failed: m_type when removing the destination link object. (realm/realm-core#5574, since v10.5.0)
    • Fixed a data race when opening a flexible sync Realm. (realm/realm-core#5573, since v10.19.0)

    Compatibility

    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.1.0 to v12.2.0. (#4679)
    • Enabled testNoMigrationOnSync. (#3312)
    Source code(tar.gz)
    Source code(zip)
    realm-v10.19.3-napi-v5-darwin-x64.tar.gz(3.03 MB)
    realm-v10.19.3-napi-v5-linux-x64.tar.gz(5.01 MB)
    realm-v10.19.3-napi-v5-win32-ia32.tar.gz(3.01 MB)
    realm-v10.19.3-napi-v5-win32-x64.tar.gz(3.45 MB)
  • v10.19.2(Jun 20, 2022)

    Enhancements

    • None.

    Fixed

    • Fixed incorrect @realm.io/common version in package.json causing install issues for users upgrading from older version of the realm npm package ([#4657, since v10.18.0])

    Compatibility

    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgrade Example to RN v0.68.2
    • Upgrade dependencies of the Realm Web integration tests
    • Throw instances of Error instead of plain objects on app errors.
    • Make integration tests on React Native Android connect to host machine by default
    Source code(tar.gz)
    Source code(zip)
    realm-v10.19.2-napi-v5-darwin-x64.tar.gz(3.03 MB)
    realm-v10.19.2-napi-v5-linux-x64.tar.gz(5.01 MB)
    realm-v10.19.2-napi-v5-win32-ia32.tar.gz(3.01 MB)
    realm-v10.19.2-napi-v5-win32-x64.tar.gz(3.45 MB)
  • v10.19.1(Jun 7, 2022)

    Enhancements

    • None.

    Fixed

    • None.

    Compatibility

    • Atlas App Services.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Removed support for node.js v12 and earlier versions and bumped to Node-API v5.
    • Fix FLX error scenario tests.
    • Fixed a bug preventing opening a synced Realm as a local Realm. (since v10.18.0)
    Source code(tar.gz)
    Source code(zip)
    realm-v10.19.1-napi-v5-darwin-x64.tar.gz(3.04 MB)
    realm-v10.19.1-napi-v5-linux-x64.tar.gz(5.00 MB)
    realm-v10.19.1-napi-v5-win32-ia32.tar.gz(3.01 MB)
    realm-v10.19.1-napi-v5-win32-x64.tar.gz(3.46 MB)
  • v10.19.0(Jun 2, 2022)

    Enhancements

    • Creating an object for a class that has no subscriptions opened for it will throw an exception. (realm/realm-core#5488)
    • Added support asymmetric sync. Object schemas can be marked as asymmetric when opening the Realm. Upon creation, asymmetric objects are sync'd unidirectionally and cannot be accessed locally. Asymmetric sync is compatible with flexible sync. (#4503)
    const Person = {
      name: "Person",
      asymmetric: true, // this marks "Person" as asymmetric
      primaryKey: "id",
      properties: {
        id: "objectId",
        name: "string",
        age: "int",
      },
    };
    

    Fixed

    • Add canonical schema type for returned schemas. (#4580)
    • Fixed invalid type for schema properties. (#4577)
    • FLX sync subscription state changes will now correctly be reported after sync progress is reported. (realm/realm-core#5553, since v10.18.0)

    Compatibility

    • Atlas Device Sync.
    • Realm Studio v12.0.0.
    • APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
    • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

    Internal

    • Upgraded Realm Core from v12.0.0 to v12.1.0.
    • Fix for updated FLX sync error message. (#4611)
    • Updated build script to use Xcode 13.1 to match latest Apple App Store compatibility. (#4605)
    Source code(tar.gz)
    Source code(zip)
    realm-v10.19.0-napi-v4-darwin-x64.tar.gz(3.04 MB)
    realm-v10.19.0-napi-v4-linux-x64.tar.gz(5.00 MB)
    realm-v10.19.0-napi-v4-win32-ia32.tar.gz(3.01 MB)
    realm-v10.19.0-napi-v4-win32-x64.tar.gz(3.46 MB)
    realm-v10.19.0-napi-v5-darwin-x64.tar.gz(3.04 MB)
    realm-v10.19.0-napi-v5-linux-x64.tar.gz(5.00 MB)
    realm-v10.19.0-napi-v5-win32-ia32.tar.gz(3.01 MB)
    realm-v10.19.0-napi-v5-win32-x64.tar.gz(3.46 MB)
Owner
Realm
Realm is a mobile database: a replacement for SQLite & ORMs. SDKs for Swift, Objective-C, Java, Kotlin, C#, and JavaScript.
Realm
Fast and advanced, document-based and key-value-based NoSQL database.

Contents About Features Installation Links About Fast and advanced, document-based and key-value-based NoSQL database. Features NoSQL database Can be

null 6 Dec 7, 2022
Simple key-value storage with support for multiple backends

Simple key-value storage with support for multiple backends Keyv provides a consistent interface for key-value storage across multiple backends via st

Luke Childs 2k Jan 7, 2023
A database library stores JSON file for Node.js.

concisedb English | 简体中文 A database library stores JSON file for Node.js. Here is what updated every version if you want to know. API Document Usage B

LKZ烂裤子 3 Sep 4, 2022
Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

DbGate 2k Dec 30, 2022
A remote nodejs Cached sqlite Database Server, for you to have your perfect MAP Cache Saved and useable remotely.

A remote nodejs Cached sqlite Database Server, for you to have your perfect MAP Cache Saved and useable remotely. Easy Server and Client Creations, fast, stores the Cache before stopping and restores it again! it uses ENMAP

Tomato6966 6 Dec 18, 2022
A wrapper for abstract-leveldown compliant stores, for Node.js and browsers.

levelup Table of Contents Click to expand levelup Table of Contents Introduction Supported Platforms Usage API Special Notes levelup(db[, options[, ca

Level 4k Jan 9, 2023
Persisted global stores for Alpine 3.x.

✨ Help support the maintenance of this package by sponsoring me. Fern Persisted global stores for Alpine 3.x. Installation Since Fern directly extends

Ryan Chandler 25 Dec 15, 2022
mini-stores - 小程序多状态管理库,支持微信/支付宝/钉钉/百度/字节/QQ/京东等小程序,小巧高性能,新老项目都可使用。

mini-stores - 小程序多状态管理 前言 安装 API 使用 创建store 创建页面 创建组件 视图上使用 更新状态 使用建议 快捷链接 前言 公司好几款产品使用钉钉小程序开发,和其他平台小程序一样,都没有官方实现的状态管理库,用过redux、vuex、mobx等状态管理库的前端小伙伴都

linjc 104 Dec 27, 2022
🔥 Dreamy-db - A Powerful database for storing, accessing, and managing multiple database.

Dreamy-db About Dreamy-db - A Powerful database for storing, accessing, and managing multiple databases. A powerful node.js module that allows you to

Dreamy Developer 24 Dec 22, 2022
DolphinDB JavaScript API is a JavaScript library that encapsulates the ability to operate the DolphinDB database, such as: connecting to the database, executing scripts, calling functions, uploading variables, etc.

DolphinDB JavaScript API English | 中文 Overview DolphinDB JavaScript API is a JavaScript library that encapsulates the ability to operate the DolphinDB

DolphinDB 6 Dec 12, 2022
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used

null 30.1k Jan 3, 2023
A javascript library to run SQLite on the web.

SQLite compiled to JavaScript sql.js is a javascript SQL database. It allows you to create a relational database and query it entirely in the browser.

SQL.JS 11k Jan 7, 2023
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite datab

MikroORM 5.4k Dec 31, 2022
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server & SQLite

Prisma Quickstart • Website • Docs • Examples • Blog • Slack • Twitter • Prisma 1 What is Prisma? Prisma is a next-generation ORM that consists of the

Prisma 28k Jan 2, 2023
WebAssembly SQLite with experimental support for browser storage extensions

wa-sqlite This is a WebAssembly build of SQLite with experimental support for writing SQLite virtual filesystems and virtual table modules completely

Roy Hashimoto 260 Jan 1, 2023
Ecommerce-backend-nestjs - Ecommerce app with Nestjs + Prisma ORM + GraphQL + SQLite

ECOMMERCE BACKEND NESTJS APP Nestjs + Prisma ORM + GraphQL + SQLite USER Create Account Login Product Create Product Get Products Get Product Search P

Rui Paulo Calei 5 Apr 6, 2022
Same as sqlite-tag but without the native sqlite3 module dependency

sqlite-tag-spawned Social Media Photo by Tomas Kirvėla on Unsplash The same sqlite-tag ease but without the native sqlite3 dependency, aiming to repla

Andrea Giammarchi 17 Nov 20, 2022
A Node.js ORM for MySQL, SQLite, PostgreSQL, MongoDB, GitHub and serverless service like Deta, InspireCloud, CloudBase, LeanCloud.

Dittorm A Node.js ORM for MySQL, SQLite, PostgreSQL, MongoDB, GitHub and serverless service like Deta, InspireCloud, CloudBase, LeanCloud. Installatio

Waline 21 Dec 25, 2022