Backendless Support
 
Solved

_wrapAsync in javascript SDK

Hi,

There seems to be a bug in the javascript SDK. There is

  1. UserService.prototype = {
  2. _wrapAsync: function(async, stayLoggedIn) {
  3. var me = this, success = function(data) {
  4. currentUser = me._parseResponse(tryParseJSON(data), stayLoggedIn);
  5. async.success(me._getUserFromResponse(currentUser));
  6. }, error = function(data) {
  7. async.fault(data);
  8. };
  9. return new Async(success, error);
  10. },

which is used throughout the UserService module. It however contains behaviour to handle a login request (or a request returning a user object anyway).

In the get getUserRoles method for example, _wrapAsync should not be used. Not sure about other places, but I had to disable it at that place because I requested the user roles after login, and the wrapper code messed up the stayLoggedIn functionality.

Kind regards,

Jeroen

Leave a Comment

Comments (3)

photo
1

Hello, Jeroen!

Thank you for reporting it, it looks that you're right. I've created an internal ticket for this topic and we shall work on it. Ticket ID is BKNDLSS-13006.

Best regards,

Alex

photo
1

was this fixed?

photo
1

Yes

photo