SaveInBackground not going inside the call back

As my app is getting bigger, more features stops working.
so i have 2 clasess, “rooms” and “messages”
when you send a “message” to a room, i was updated “rooms.unread = [users]” which stopped working then i did it in cloud code
now when i send message

message().saveInbackground, save, saveEventually nothing seems to work.

I didn’t quite understand what you said, but are you doing it inside an afterSave / beforeSave? If so, are you waiting for this code to execute before continuing with the function execution?

I didnt understand what you asking but I think you should use await.

For example:
Instead of doing this
message.save();

do this
var m2 = await message.save();

Sorry for the late reply, this is ios swift app

    let m = Message() . <= Parse Object
    m.byUser = self.currentUser
    m.userId = self.currentUser.objectId!
    m.content = content
    m.type = "text"
    m.chatRoom = thisRoom
    m.usersName = self.currentUser.firstName
    m.chatRoomId = thisRoom.objectId!
    m.horse = thisRoom.forHorse
    m.horseId = thisRoom.forHorse.objectId!
    m.saveInBackground { (saved, e) in {
        //NOT COMING HERE//
    }

So this is the code to save the sent message to parse, which works perfectly fine for 90% of the users who has “less chatrooms/messages”

i have 2 PFObjects here ChatRoom And Message
ChatRoom is the list of rooms a user has and Message is messages sent to the selected chatroom

When the app starts, i download all the Message and Chatrooms and save in in local storage. and download new messages using live query… So if you select a “ChatRoom” it will open all “Message” pfobjects from local storage … which works fine

so lets say userA has 10 chatrooms & 100 Messages, this works fine and callback works fine
but userB has 100+ chatrooms and alot of messages… so sending message doesn;t work for this user

Edit: i’m not sure whats happening if user has alot of data, i have even in background/main/ different threads

The callback should be called at least with an error no matter how many messages they have. Do you see any error message in your iOS app? Do you have any trigger in place for this class Message?

no errors, no return nothing… never comes inside the call back… sometimes it does but after like 1-5 mins

Do you have any trigger to this class?

Do you have any trigger to this class? no

That’s strange. Were are you hosting your app? Are the other api calls working fine?

aws, everythings working fine … if the user has less data … but if the user has alot of data… saves dont work

The saving operation should work in the same way besides how many messages the user has. Maybe you are trying to send/save all the data to the server and not only the new message? Can you double check?

well same code i try with other users with less data works fine… right now we decided to create cloud code to save messages until we find the solution and it works fine. …

It looks like a good idea. Let me know if your problem persists with the cloud code.

it works with cloud code, but using save/savinback/saveEven is more important, right?
problem with cloud code is it doesn’t pass the user to after/before saves…

Do you mean that the triggers are not called when you save using cloud code? I think that’s not true.