Skip to content
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

RCOCOA-2333: Add tests for sync schema migrations #8542

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nirinchev
Copy link
Member

@nirinchev nirinchev commented Apr 10, 2024

This adds tests for sync schema migrations. The feature is enabled by specifying a non-zero schemaVersion on the realm configuration, so we already supported it, so this is only adding test to ensure the value is correctly routed to Core/Sync/Server.

@@ -143,8 +143,9 @@ typealias Json = Any
#endif

private extension ObjectSchema {
func stitchRule(_ partitionKeyType: String?, id: String? = nil, appId: String) -> [String: Json] {
func stitchRule(_ partitionKeyType: String?, id: String? = nil, appId: String, title: String?) -> [String: Json] {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is required to ensure that the title of the collection matches the name of the table whenever we override the table name using _realmObjectName.


// We only need to create the userData rule for .pbs since for .flx we
// have a default rule that covers all collections
let userDataRule: [String: Json] = [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current baas version will error out if we attempt to insert this rule for a qbs app because it's incompatible with qbs rules.

Comment on lines -992 to -994
session.privateApps[appId].settings.patch(on: group, [
"sync": ["disable_client_error_backoff": true]
], failOnError)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting a 403 when we attempt to execute this request. I need to check if it's still necessary and why we're no longer authorized to make it.

@@ -1,7 +1,7 @@
{
"events": {
"database": {
"maxCoordinatorChangeStreams": 50000
"maxCoordinatorChangeStreams": "50000"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current baas expects this to be a quoted int.

@@ -1,3 +1,3 @@
VERSION=10.49.1
REALM_CORE_VERSION=v14.5.0
STITCH_VERSION=8bf8ebcff6e804586c30a6ccbadb060753071a42
STITCH_VERSION=88756085ea34f3887669cd6d7764aedf44795b44
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to bump this to pick up some fixes for the schema versioning functionality.

@nirinchev nirinchev changed the title Add tests for sync schema migrations RCOCOA-2333: Add tests for sync schema migrations Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant