Incorrect objectId for newly created user

Hi guys, this looks a similar type error to this Adding new record error but that fix didn’t work.

So this time in a backendless 4 javascript app.

I login as an admin user to the app.

The admin user creates a user.
like this…

function userRegistered( user )
{
var user = new Backendless.User();
user.name = data.name;

}

   Backendless.UserService.register( user ).then( userRegistered ).catch( gotError );

That all works fine, user.objectId is correct and matches that as in the Backendless console. If I logout of the app and login back in and edit this user that is all fine too.

However if I don’t log out and then happen to try and edit or delete that user straight away then I get the wrong objectId of the user somehow.

I get an objectId more like this, 15477542162520 instead of normal type format

If I logout and logback in it works perfectly.

Anything you can think of, it is like the logging out and in is flushing something through. It only happens on newly created users. Once I logout and logbback in all users have correct objectId.

Actually I have a feeling it may well be a logic error in my datatables.net code, but just wonder if you have come across something like this before and have any suggestions?

Mike

Hi Mike

No, we didn’t come across the issue before.
The new objectId looks like on timestamp, maybe there is any modification with the newly user in your code
Did you try to debug when the newly created user start having the wrong objectId?
Do you get correct object(user) values from the server on user registration, you can check it in Browser Dev Console in “Network” section?

Regards, Vlad

Hi Vlad

Thank you for your help. Just to confirm this was not a backendless issue (sorry for wasting your time). It was indeed a timestamp and this helped me sort the issue out so thank you.

Hi Mike

it’s ok, never mind
I’m glad that you’ve solved the issue

Regards, Vlad