Download data, parse it and replace local data
Realm Delete all should delete all objects from realm and new set of objects should be replaced
The "Post" object is parsed correctly and once it is send to realm to copy it is not copied as it should, as you can see on the image the Post= proxy object has the correct values set, but the actual values on the RealmProxy object are nulls or empty or set to default values.

E.g. full stack trace with exception
No exception shownSteps & Code to Reproduce
final RealmResults
if (response.getPostList() != null && response.getPostList().size() > 0) {
realm.beginTransaction();
results.deleteAllFromRealm();
//response has post list with correct parsed objects
//results is empty
realm.copyToRealm(response.getPostList());
//results has the values returned from the server but with null values
realm.commitTransaction();
Describe your current debugging efforts.
I followed the code and the "copyToSource" object used to copy the values have null values in all the fields, there is not exception on the code
On RealmProxy object method copyOrUpdate()
RealmObjectProxy cachedRealmObject=null;
then Copy method is executed, on copy method realmObjectSource includes all the correct data in all fields, but once it is accessed on realmGet it returns default value

public class Post extends RealmObject implements IModel<Integer> {
@PrimaryKey
@SerializedName("Id")
private int id;
@SerializedName("UserId")
private int userId;
@SerializedName("GroupId")
private int groupId;
@Override
public Integer getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public int getGroupId() {
return groupId;
}
public void setGroupId(int groupId) {
this.groupId = groupId;
}
}
Realm version(s): 4.3
Realm sync feature enabled: yes/no
Android Studio version: 3.0.1
Which Android version and device: it is happening with multiple devices
Nexus 6 and version 27
https://realm.io/docs/java/latest/#android-studio-debugging-android-studio-debugging
(it's because managed RealmObject property access is lazy-loaded)
Most helpful comment
https://realm.io/docs/java/latest/#android-studio-debugging-android-studio-debugging