-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RKOTLIN-1079] Add support for transfer progress estimate #1575
Conversation
# Conflicts: # packages/cinterop/src/nativeDarwin/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt # packages/external/core # packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp # packages/jni-swig-stub/src/main/jni/realm_api_helpers.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't done a full review, but we should also enable and test this for FLX sync.
CHANGELOG.md
Outdated
@@ -4,11 +4,12 @@ | |||
This release will bump the Realm file format from version 23 to 24. Opening a file with an older format will automatically upgrade it from file format v10. If you want to upgrade from an earlier file format version you will have to use Realm Kotlin v1.13.1 or earlier. Downgrading to a previous file format is not possible. | |||
|
|||
### Breaking changes | |||
* None. | |||
* Sync progress updates no longer report `transferredBytes` and `totalBytes`. (Issue [#1744](https://github.com/realm/realm-kotlin/issues/1744) [RKOTLIN-1079](https://jira.mongodb.org/browse/RKOTLIN-1079)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the new values are the enhancement, but I think I would have combined both into one breaking change entry and put emphasis on the new better precision ... And support for flx-sync, right?
...test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/ProgressListenerTests.kt
Outdated
Show resolved
Hide resolved
...t-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/PBSProgressListenerTests.kt
Outdated
Show resolved
Hide resolved
...t-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FLXProgressListenerTests.kt
Outdated
Show resolved
Hide resolved
...t-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FLXProgressListenerTests.kt
Show resolved
Hide resolved
// Await the flow actually being active, this requires actual data transfer as | ||
// we arent guaranteed any initial events. | ||
writerRealm.writeSampleData(TEST_SIZE, timeout = TIMEOUT) | ||
mutex.lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this will not timeout (if the test fails) only if the Job is cancelled. https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.sync/-mutex/lock.html
maybe wrap with withTimeout(TIMEOUT)
...t-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/PBSProgressListenerTests.kt
Outdated
Show resolved
Hide resolved
…mongodb/common/FLXProgressListenerTests.kt Co-authored-by: Nabil Hachicha <nabil.hachicha@mongodb.com>
# Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - There are a number of places where the tests could hang if they fail in unexpected ways. Don't think it is critical, so maybe we could just do that in a later PR.
...t-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/PBSProgressListenerTests.kt
Outdated
Show resolved
Hide resolved
// `flow.collect()` can be called. | ||
channel.receiveOrFail() | ||
realm.close() | ||
job.await() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could hang forever if the test fails in some unexpected way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a ticket to address this after the PR. We should revisit these tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core now reports progress estimates during a Download/Upload. This PR adds support for it.
The progress estimate is a double ranged between 0 - 1.
Depends on realm/realm-core#7124
Closes #1744