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

Getting exception The class TripModel is not in the limited set of classes for this realm #3638

Closed
sledderGIT opened this issue Jul 5, 2024 · 5 comments
Assignees
Labels
App-type:Xamarin More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. O-Community SDK-Use:Local T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@sledderGIT
Copy link

sledderGIT commented Jul 5, 2024

What happened?

Just started to get an exception
System.ArgumentException: The class TripModel is not in the limited set of classes for this realm (Parameter 'T')

using Realms;

namespace CTeleport.Mobile.Core.RealmStore.Trips;

public class TripModel: RealmObject
{
    public TripModel()
    {
    }
    
    [Indexed]
    public DateTimeOffset EndingDate { get; set; }

    [Indexed]
    public DateTimeOffset CreatedAt { get; set; }
    
    [Indexed]
    public DateTimeOffset UpdatedAt { get; set; }
    
    [PrimaryKey]
    public string Id { get; set; }
    public string TravelerName { get; set; }
    public IList<BookingModel> Bookings { get; }
}

Repro steps

  1. RealmInstance.All<TripModel>().Count();
  2. System.ArgumentException: The class TripModel is not in the limited set of classes for this realm (Parameter 'T')

Version

.NET 8

What Atlas Services are you using?

Local Database only

What type of application is this?

Xamarin

Client OS and version

iOS simulator 17.2 Realm 12.2

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

Copy link

sync-by-unito bot commented Jul 5, 2024

➤ PM Bot commented:

Jira ticket: RNET-1163

@nirinchev
Copy link
Member

How do you open the Realm instance? Particularly, how does the config look like?

@sledderGIT
Copy link
Author

    public async Task<Realm> GetRealmInstance(string id)
    {
        return await Realm.GetInstanceAsync(GetRealmConfig(id));
    }

    public RealmConfiguration GetRealmConfig(string id)
    {
        return new RealmConfiguration(id)
        {
            SchemaVersion = RealmVersion,
            ShouldDeleteIfMigrationNeeded = true
        };
    }

Nothing extrodinary I would say :)

@nirinchev
Copy link
Member

Are the models that you use and the code that opens the Realm in the same assembly?

@nirinchev nirinchev self-assigned this Jul 22, 2024
@nirinchev nirinchev added the More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. label Jul 22, 2024
@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Jul 22, 2024
Copy link
Contributor

github-actions bot commented Aug 6, 2024

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed Aug 6, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
App-type:Xamarin More-information-needed More information is needed to progress. The issue will close automatically in 2 weeks. O-Community SDK-Use:Local T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

2 participants