realm-browser-osx icon indicating copy to clipboard operation
realm-browser-osx copied to clipboard

Modifications are sometimes lost when reopening or switching to another model

Open balazsgerlei opened this issue 9 years ago • 5 comments

Hi! I don't know if I am doing something wrong but the Realm browser simply does not work in most cases. I'm trying to edit a Realm which was created on Android by the Realm Java version 0.90. I'm using the RealmBrowser v0.101.0 downloaded from the app store. I use the Realm Browser in OSX El Capitan.

This is my experience so far:

  • When I open my realm file, I try to add a new "row" with Edit/Add new object. It adds the new row, assigning a random Integer for the first column, which is the primary key. But after thism every edit I made is immediately lost when I switch to another class in the left plane, or close and reopen the realm browser.
  • When the browser does the above thing, the "Add new object" and "Delete object" items in the Edit menu are not working either. Sometimes, they even crash the Realm Browser itself.
  • The weird thing is that the same thing happens sometimes if I edit existing values, but then most of the time, closing the app, deleting the ".realm.lock" file and the ".realm.management" folder fixes it
  • Then I tryed exporing the realm into CSV and edit the fields there, but unfortunately I have a "column" which is boolean which is exported to CSV with number 0-1 representation, so when I reimport the CSV it is no longer a boolean. So no luck editing it this way either

Could you help me figuring out what is wrong? I cannot edit my realm files this way.

balazsgerlei avatar May 08 '16 19:05 balazsgerlei

I tried the same with the "Generate demo database" option in tools menu, and the same thing happens. When I add a new object, it adds a new "row" with a random value to the first "column", but any modification I make in that row disappears as soon as I change to another class in the left plane and back.

And I tried pressing enter after changing something or simply clicking outside the field I am editing, but the same thing happens either way.

If I'm on the other hand try to modify an existing value in the demo database, the modification only disappears when I click outside the field I edited and then switch to another class and then back. If I press enter after the modification it does not disappear after the switching. Still this is weird, but at least the modification persist when pressing enter.

balazsgerlei avatar May 08 '16 19:05 balazsgerlei

Hi!

I managed to grab an error report of one of the crashes (I was editing a realm, deleted an object and tried to modify the primary key of another one, than the waiting "lollipop" appeared and the app hang. After a couple of minutes I force quitted it, and than got a crash. If you are interested in the actual report, please let me know where to send it.

balazsgerlei avatar May 09 '16 12:05 balazsgerlei

An update on the situation. I updated Realm in my app to 1.0.0 and the Realm browser to 0.103.1 via the Mac App Store. When I open Realms created by the app, I am now able to modify existing "rows"/Objects and even ones that are added with the Edit/Add New Object menu. These modifications do persist after closing and reopening the Realm Browser now except one that I detail below:

The problems that still remain is that any modification to the primary key still does not persist when I close and reopen the Browser, or switch to another model element in the left "Models" pane. And even the other modifications only persist when I press enter after editing. It is a small nuance, but can be frustrating when I click on another part of the app to finish editing, and it seems that my modification is persisted, but it is lost when closing the app and reopeing, or even when switching to another model element in the left pane.

I hope you could take a look at this issue soon! Thanks!

balazsgerlei avatar Jun 05 '16 11:06 balazsgerlei

Hi @balazsgerlei!

Sorry for the lack of communication! Thanks a lot for your issue reports! I'll focus on your last reported issue in here. If you're still having trouble with the other issues, please create other GitHub issues for them.

I had a quick look at the issue you're describing, and I was able to reproduce it here. For some reason, making changes to a primary key field fails, and is apparently throwing an exception due to a write transaction being left open somewhere else.

I'll need to do some research to figure out why this is happening. Thanks a lot for reporting it!

TimOliver avatar Jun 05 '16 17:06 TimOliver

Hi, Thanks for looking at this issue. Its totally OK if you concentrate on the last issue (problems with changing the primary key), as the other problems seems to be fixed in the latest version.

balazsgerlei avatar Jun 06 '16 12:06 balazsgerlei