Getting a random crash on a standard Find query

pretty self explanatory. This was happening before with the asynchronous requests so we had to change to synchronous requests and it was working fine for a little while. But not anymore :frowning:

I have updated the SDK to the latest and the problem is still there

This is the Follow class

class Follow: BackendlessEntity {

    var user : BackendlessUser?

    var followUser : BackendlessUser?


This is the table:

Hi, Miroslav.
I have tried to make similar table and to invoke simple find requests through REST console - everything is working.
Please, provide code example which demonstrate a problem.

Hi Oleg,

what kind of code example would you like me to give you? This is the code that is causing the issue:

But this is not the issue of just one method. It happens every here and then in many places.

Hi Miroslav,

Does the error occur for the same set of data or perhaps the returned objects differ from request-to-request?


Great question, yes it does! But the data looks normal for that request. Furthermore, in this table there are only backend less users, so there is nothing custom about it. It should be a clear case. Maybe if the users themselves contained some unexpected data? Do you know how could that happen?</img>

Thank you

I see you have auto-loads turned for “followUser” and “user”. As a result, it is likely there will be a circular dependency (user A references user B who in turn references user A). This is very likely to cause the crash. Auto-load is a great feature which we envisioned would be used for quick prototyping (to reduce amount of code you write), however, it is not recommended for production quality apps. The recommended way is to load relations through the “two-step retrieval”. Could you try disabling auto-loads and see if the crashes go away?

we’ll try that, thank you very much and thank you for the explanation!

Thank you Mark, it worked!

We are experiencing it again. No autoloads on the “Follow” class, but the same error as on the screenshot. Same file, same line of code. It is working sometimes, but not all the time.

Could there be any other explanation?

Do you have any auto-loads enabled?