-
Notifications
You must be signed in to change notification settings - Fork 87
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
RDART-973: Add support for the new progress notifications #1546
Merged
Merged
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b38114f
Add support for the new progress notifications
nirinchev f747f91
Add a sanity check
nirinchev cf96df9
..
nirinchev a550664
Merge branch 'main' into ni/progress-notifications
nirinchev cf46f95
Merge branch 'main' into ni/progress-notifications
nirinchev 1081e4b
wip
nirinchev be52695
Merge main into ni/progress-notifications
nirinchev 2a6936b
Clean up tests
nirinchev 8998654
Clean up
nirinchev 833a350
Changelog, another test
nirinchev 6e75e57
await the timeout future
nirinchev 2d0042a
Merge branch 'main' into ni/progress-notifications
nirinchev 2e99ae6
Use realm-core 14.8.0
nirinchev 5a901d0
downgrade core
nirinchev c7ff71f
Merge branch 'main' into ni/progress-notifications
nirinchev 1e49bd2
disable failing test
nirinchev c3a6142
Rework test
nirinchev 729c3b6
Merge branch 'main' into ni/progress-notifications
nirinchev f1c44d4
Merge branch 'main' into ni/progress-notifications
nirinchev 8151b87
Fix core version
nirinchev af5ba52
Tweak test so it passes
nirinchev 052ceb1
Merge branch 'main' into ni/progress-notifications
nirinchev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule realm-core
updated
5 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,7 +418,7 @@ void setupTests() { | |
|
||
Realm.logger.setLogLevel(LogLevel.detail); | ||
Realm.logger.onRecord.listen((record) { | ||
testing.printOnFailure('${record.category} ${record.level.name}: ${record.message}'); | ||
testing.printOnFailure('${DateTime.now().toUtc()} ${record.category} ${record.level.name}: ${record.message}'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
}); | ||
|
||
// Enable this to print platform info, including current PID | ||
|
@@ -606,17 +606,24 @@ Future<User> getAnonymousUser(App app) { | |
return app.logIn(Credentials.anonymous(reuseCredentials: false)); | ||
} | ||
|
||
Future<Realm> getIntegrationRealm({App? app, ObjectId? differentiator, AppConfiguration? appConfig}) async { | ||
FlexibleSyncConfiguration getIntegrationConfig(User user) { | ||
return Configuration.flexibleSync(user, getSyncSchema())..sessionStopPolicy = SessionStopPolicy.immediately; | ||
} | ||
|
||
Future<Realm> getIntegrationRealm({App? app, ObjectId? differentiator, AppConfiguration? appConfig, bool waitForSync = true}) async { | ||
app ??= App(appConfig ?? await baasHelper!.getAppConfig()); | ||
final user = await getIntegrationUser(app: app, appConfig: appConfig); | ||
|
||
final config = Configuration.flexibleSync(user, getSyncSchema())..sessionStopPolicy = SessionStopPolicy.immediately; | ||
final config = getIntegrationConfig(user); | ||
final realm = getRealm(config); | ||
if (differentiator != null) { | ||
realm.subscriptions.update((mutableSubscriptions) { | ||
mutableSubscriptions.add(realm.query<NullableTypes>(r'differentiator = $0', [differentiator])); | ||
}); | ||
|
||
await realm.subscriptions.waitForSynchronization(); | ||
if (waitForSync) { | ||
await realm.subscriptions.waitForSynchronization(); | ||
} | ||
} | ||
|
||
return realm; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you elaborate the explanation of this part a bit? Why will we not see more upload callbacks here, when we add and wait for upload?
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.
Because the subscription we setup is for
ProgressMode.forCurrentlyOutstandingWork
, which ends when you've reached 100% and no further callbacks will be invoked as more data comes in/goes out.