Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-12

Xamarin Forms migration continues to fail

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      Freshdesk Ticket ID: 2837
      Freshdesk Ticket Agent: Eric.mossman
      Freshdesk Ticket Agent Email: eric.mossman@realm.io
      Ticket Priority: Low
      Freshdesk Ticket Description:

      Note: Following is the text of a message I just tried to send you. However your server rejected the attachment of my zipped sample app.
       
      Here, then is just the text. Please let me know how to submit the sample; it is under 1 MB.
       
      Months ago I submitted a sample app illustrating the problem and received indication it would be investigated.
      I've heard no more and the last two Realm releases have not solved the problem.
       
      I do appreciate you likely have a heavy workload, but this is causing me a lot of headaches and if it can be remedied that would be a true blessing.
      Dozens of times I've had to completely uninstall my app being developed from simulators and devices just to be able to add or modify a single Realm Object.
      I cannot release the app, nearly finished, with such a fatal flaw. If I did, I could never update its schema.
      Or is there any way to have Realm ignore this "error"!
       
      I have several times seen the "explanation" that somehow Realm got called in an app before migration began, causing it to keep an old schema version even after migration.
      I admit to being human and very possibly blind to where that might be happening, but days of fruitless looking in my actual app and my test app have revealed nothing.
       
      I am again re-submitting a sample app, RealmTest, with fully updated references and a helpful try-catch block I should have had before.
      RealmTest does nothing more than create a single Realm instance called Primary, with a single instance of a Realm Object called AccountR.
      If it runs to the end without exceptions the only thing visible on a simulator is Prism's "Welcome to Xamarin Forms and Prism" default screen.
       
      RealmTest.Android has failed (in the manner I'll describe) when run in simulators on latest Windows 10  64-bit (1809) in Visual Studio 2017 15.8.9 and on latest version of Mac mini with latest Visual Studio 2017 for Mac.
      The iOS version failed similarly on the Mac mini.
       
      To test, beginning with copy of lines 17 - 26 of Database.cs, with additional comments:
       
      private readonly ulong schemaVersion = 0; //Start testing with the default value of 0, increment on each schema change

              // Example:
              //   1. Do the initial install, placing breakpoints at lines 141 and 163. App runs OK. Art line 163 the "acct" variable has an original SequenceNumber property.
              //   2. Restart debugging a few times to show restarts are OK.
              //   3. Change schemaVersion above to 1 AND do a universal renaming of "SequenceNumber" to something else, like "SequenceNumbe".
              //   4. In line 223 change the oldAccount attribute back to "SequenceNumber". VITAL!!
              //   5. On that first update migration occurs and App still runs OK. At line 163 "acct" now has the revised "SequenceNumbe" property, not "SequenceNumber".
              //   6. Restart debugging. On all debugging restarts App crashes, reporting at line 141 it now has inconsistent values:        //      "Provided schema version 0 is less than last set version 1."
       
      Also, if you have a Xamarin Forms reference app that demonstrates migration involving renaming or adding a property, great.
      I know your docs outline how to do it, but a real app that actually works would be great!
       
      In addition to all this, I've tried downloading your open-source Realm Xamarin git repository and struggled mightily with getting the wrappers updated as described in the various read-mes.
      I did manage to get RealmTests.iOS running OK, but efforts to get Android and Windows Universal wrappers only ended with the various folders being created in the Build folder, but all were empty.
      (BTW: 2 of the iOS tests do fail.)
       
      However, even with the iOS version, I couldn't see which projects I could possibly reference in a variation of my RealmTest to replace all the Realm nuget packages with dlls from your RealmTests .
      Any suggestions on that and perhaps on getting the Android and UWP wrappers as well?
       
      Thank you.
       
      David Pressman
       

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: