realm / realm-browser-osx

DEPRECATED - Realm Browser for Mac OS X has been replaced by realm-studio which is cross platform.
https://realm.io
501 stars 54 forks source link

Creating a new object in a table with an optional data property creates a data pointer & displays extra fields #368

Open dhmspector opened 6 years ago

dhmspector commented 6 years ago

In Realm Browser Version 3.0.1 (98), creating a new object in a table with an optional data property creates a data pointer object rather then an empty (null) field:

screen shot 2017-11-28 at 12 46 56 pm

Notice also that there are 2 extra fields here (conversationId and userId) that are not in the schema below but are shown in in the table display

The data schema represented here is:

const ChatMessageSchema = {
    name: 'ChatMessage',
    primaryKey: 'messageId',
    properties: {
        messageId: 'string',
        mimeType: 'string',
        extraInfo: { type: 'data', optional: true },
        text: 'string',
        timestamp: 'date',
        user: { type: 'User', optional: true }
    }
};

The same effect (for the extra fields) is not seen in the Realm Studio (Version 1.8.0 (1.8.0.155) ) version of the same display: chat model - studio

(the server example used here is from the https://github.com/realm/reach project - its server is minimal and self-contained and can be quickly set up to recreate this issue)