Skip to content

Commit 3747d21

Browse files
authored
Fix missing scheduler on Linux and Windows (JVM) (#1503)
1 parent edb07cf commit 3747d21

File tree

6 files changed

+43
-4
lines changed

6 files changed

+43
-4
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 1.11.1 (YYYY-MM-DD)
2+
3+
### Enhancements
4+
* None.
5+
6+
### Fixed
7+
* Opening a Realm would crash with `No built-in scheduler implementation for this platform` on Linux (JVM) and Windows. (Issue [#1502](https://github.com/realm/realm-kotlin/issues/1502), since 1.11.0)
8+
9+
### Compatibility
10+
* File format: Generates Realms with file format v23.
11+
* Realm Studio 13.0.0 or above is required to open Realms created by this version.
12+
* This release is compatible with the following Kotlin releases:
13+
* Kotlin 1.8.0 and above. The K2 compiler is not supported yet.
14+
* Ktor 2.1.2 and above.
15+
* Coroutines 1.7.0 and above.
16+
* AtomicFu 0.18.3 and above.
17+
* The new memory model only. See https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility
18+
* Minimum Kbson 0.3.0.
19+
* Minimum Gradle version: 6.8.3.
20+
* Minimum Android Gradle Plugin version: 4.1.3.
21+
* Minimum Android SDK: 16.
22+
23+
### Internal
24+
* None.
25+
26+
127
## 1.11.0 (2023-09-01)
228

329
### Breaking Changes

packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ actual object RealmInterop {
182182
}
183183

184184
actual fun realm_create_scheduler(): RealmSchedulerPointer =
185-
LongPointerWrapper(realmc.realm_scheduler_make_default())
185+
LongPointerWrapper(realmc.realm_create_generic_scheduler())
186186

187187
actual fun realm_create_scheduler(dispatcher: CoroutineDispatcher): RealmSchedulerPointer =
188188
LongPointerWrapper(realmc.realm_create_scheduler(JVMScheduler(dispatcher)))

packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,3 +1048,8 @@ realm_sync_thread_error(realm_userdata_t userdata, const char* error) {
10481048
env->CallVoidMethod(static_cast<jobject>(userdata), java_callback_method, to_jstring(env, msg));
10491049
jni_check_exception(env);
10501050
}
1051+
1052+
realm_scheduler_t*
1053+
realm_create_generic_scheduler() {
1054+
return new realm_scheduler_t { realm::util::Scheduler::make_dummy() };
1055+
}

packages/jni-swig-stub/src/main/jni/realm_api_helpers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,7 @@ realm_sync_thread_destroyed(realm_userdata_t userdata);
134134
void
135135
realm_sync_thread_error(realm_userdata_t userdata, const char* error);
136136

137+
realm_scheduler_t*
138+
realm_create_generic_scheduler();
139+
137140
#endif //TEST_REALM_API_HELPERS_H

packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/FullText.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ package io.realm.kotlin.types.annotations
1616
*
1717
* The full-text index currently support this set of features:
1818
*
19-
* - Only token or word search, e.g. `bio TEXT 'computer dancing'` will find all objects that
19+
* - Token or word search, e.g. `bio TEXT 'computer dancing'` will find all objects that
2020
* contains the words `computer` and `dancing` in their `bio` property.
2121
* - Tokens are diacritics- and case-insensitive, e.g.`bio TEXT 'cafe dancing'` and
2222
* `bio TEXT 'café DANCING'` will return the same set of matches.
23+
* - Token prefix search can be done using `*`, like `bio TEXT comp*`.
2324
* - Ignoring results with certain tokens are done using `-`, e.g. `bio TEXT 'computer -dancing'`
2425
* will find all objects that contain `computer` but not `dancing`.
2526
* - Tokens are defined by a simple tokenizer that uses the following rules:
@@ -29,7 +30,7 @@ package io.realm.kotlin.types.annotations
2930
*
3031
* Note the following constraints before using full-text search:
3132
*
32-
* - Token prefix or suffix search like `bio TEXT 'comp* *cing'` is not supported.
33+
* - Token suffix search like `bio TEXT '*cing'` is not supported.
3334
* - Only ASCII and Latin-1 alphanumerical chars are included in the index (most western languages).
3435
* - Only boolean match is supported, i.e. "found" or "not found". It is not possible to sort
3536
* results by "relevance" .

packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/VersionTrackingTests.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ class VersionTrackingTests {
8181
realm.activeVersions().run {
8282
assertEquals(1, all.size)
8383
assertEquals(1, allTracked.size)
84-
assertNull(notifier)
84+
// The notifier might or might not had time to run
85+
notifier?.let {
86+
assertEquals(2, it.current.version)
87+
assertEquals(0, it.active.size)
88+
}
8589
assertNull(writer)
8690
}
8791
}

0 commit comments

Comments
 (0)