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

Improvements related to Remote MongoDB access #3414

Merged
merged 26 commits into from
Feb 8, 2024

Conversation

nirinchev
Copy link
Member

@nirinchev nirinchev commented Aug 9, 2023

Description

This is still WIP, but explores a SG-based approach for using RealmObject classes for remote mongodb access.

TODO

  • Changelog entry
  • Tests (if applicable)
  • Link properties
  • Asymmetric objects
  • Embedded properties

using var realm = await GetRealmAsync(config);
await WaitForUploadAsync(realm);

var client = user.GetMongoClient(ServiceName); // TODO: this should be provided by Sync
Copy link
Member Author

@nirinchev nirinchev Nov 29, 2023

Choose a reason for hiding this comment

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

No longer relevant - in scoping we decided to keep the service name argument

// Use sync to create the schema/rules
SyncConfigurationBase config = appConfigType == AppConfigType.FlexibleSync ? GetFLXIntegrationConfig(user) : GetIntegrationConfig(user);

config.Schema = GetTransitiveSchema(typeof(T), new()).Values.ToArray();
Copy link
Contributor

Choose a reason for hiding this comment

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

How come we're trying to limit the schema here? Is it to improve the speed of the test?

# Conflicts:
#	.github/templates/build-packages.yml
#	.github/workflows/build-packages.yml
#	global.json
* Various fixes

* Removed unused

* Fixes to bsondocument equality

* Passingn tests

* Added embedded test

* Added test for embedded

* Added fix for not implemented

* Fixed serializer and added correct serialization of realm value

* Fixed tests for object in realm value

* Fixed deserialization object in realm value

* Moved method

* Split collection class

* Revert "Split collection class"

This reverts commit eee2d42.

* Added test to remove

* Removed unused class and test

* Separated serializer from serializer registry

* Added basic tests for primitives

* Added more tests

* Added tests for links

* Added several tests

* Added tests for embedded

* Removed unused param

* Removed unnecessary

* Various fixes

* Added missing cases

* Added docs and improved serialization

* Added tests

* Added saving of schema

* Added correct handling of extra fields and changelog

* Corrected exception check

* Small fixes

* Small corrections

* Moved tests to a new fixture

* Small correction

* Reinstated reflection

* Small fixes

* Warning fix

* Updated source generated test classes

* Corrected weavers errors

* Corrected platformhelper and testobject

* Fixed source generator test

* Added fix for ctor

* Small fixes

* Corrections to test
@papafe papafe marked this pull request as ready for review January 10, 2024 09:42
@papafe papafe self-assigned this Jan 10, 2024
@papafe
Copy link
Contributor

papafe commented Jan 10, 2024

I've just merged my branch into this one.
It seems the only thing left to do is decide how to deal with the change in the default serialization of types.

Copy link

coveralls-official bot commented Jan 10, 2024

Pull Request Test Coverage Report for Build 7489097804

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 80.82%

Totals Coverage Status
Change from base Build 7120095423: -0.1%
Covered Lines: 6601
Relevant Lines: 8025

💛 - Coveralls

@papafe
Copy link
Contributor

papafe commented Jan 10, 2024

@nirinchev As we discussed:

  • I've added some tests to document the issue with DateTimeOffset
  • I've added the change in the breaking change section of the changelog
  • I've added the static method Realm.SetLegacySerialization so that developers can use the previous serialization.
  • I've added a test to verify that the static method works, but unfortunately I've put the Ignore tag on it as it should only be tested manually. Serializers gets cached once used, so if we change to the legacy serialization we can't switch back.

If the CI is green (or almost) this is mergeable

@papafe
Copy link
Contributor

papafe commented Feb 7, 2024

@nirinchev The new release is out, so this is mergeable for me

@papafe papafe merged commit c4546f9 into main Feb 8, 2024
64 of 67 checks passed
@papafe papafe deleted the ni/remote-mongo-improvements branch February 8, 2024 12:17
@papafe papafe mentioned this pull request Feb 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants