Codeless deploy drops method-closing } in generated index.js (inspect 14032)

Backendless Version (3.x / 6.x, Online / Managed / Pro)

Backendless Online (cloud), current console. App name: brilliant_grades.

Client SDK (REST / Android / Objective-C / Swift / JS)

JS Cloud Code / Codeless API Service. Editor: Logic Designer Custom Code. Also edited generated index.js in File Service.

Application ID

4A47197B-AE30-FA84-FF56-0071F4010900

Expected Behavior

  1. Open a Codeless API Service method whose body is one Custom Code block (a large async script is enough; business logic does not matter).
  2. Deploy the service from Logic Designer (Save and Deploy All).
  3. Generated File Service index.js should emit a complete class: each method must close with } after /*METHOD_BODY*/ before the next /*METHOD …*/ marker.
  4. Code inspection should pass. A later method in the same service should start outside the previous method.

Minimal expected shape:

async SomeMethod(event) {
/*METHOD_BODY*/
  await (async function() {
    // custom code
  })();
}
/*METHOD NextMethod*/

Actual Behavior

  1. After Logic Designer deploy of Codeless service BG_04_FUTURE_ONBOARDING, generated servercode/CODELESS/BG_04_FUTURE_ONBOARDING/{DRAFT|PRODUCTION}/index.js omits the closing } of at least these methods:
  • Future_Onboarding_Microschool
  • Future_Onboarding_Main_Method
  1. The next method’s comment and async …( then sit inside the previous method. Inspection fails:
  • Error during code inspection — code 14032
  • or Error at <line>: Unexpected token '{' (the next method’s {)
  1. Manually adding one } in File Service after that method’s })(); / /*METHOD_BODY*/ makes node --check and Backendless inspect succeed. Deploy then works.
  2. Deploying the same methods again from Logic Designer regenerates index.js and drops those } again. File Service and Logic Designer fight each other.
  3. Custom Code is wrapped as await (async function() { … })();. That wrapper is fine. The missing token is the outer method }, not the IIFE.

Broken junction we keep seeing:

  })();

  return 200

/*METHOD_BODY*/
/*METHOD Future_Onboarding_Microschool_CoTeacher

Required junction:

  })();

  return 200

/*METHOD_BODY*/
}
/*METHOD Future_Onboarding_Microschool_CoTeacher

Same pattern at the end of Future_Onboarding_Main_Method before Reactivation_Future_Onboarding_Trigger_Part_3.

What we need from you

Confirm whether Logic Designer is supposed to emit that closing } for Custom Code methods, and fix generation so Deploy All does not produce an unparsable index.js. Workarounds (hand-editing File Service index.js after every deploy) are not safe.

Hi @Andreas_Marinopoulos

I am trying to reproduce your issue. Here is what I do:

  1. I download your BG_04_FUTURE_ONBOARDING service and uploaded to my app
  2. then I deployed the service without any changes (I believe this version works for you as well)
  3. then I open the codeless designer and do some changes (change blocks position) to trigger code recomposition and to be able to deploy these changes for the following services:
  • Future_Onboarding_Microschool
  • Future_Onboarding_Main_Method
  1. then I deploy it without any problems

So, perhaps I miss something, but as you can see, the code generation does not miss any } characters and the deploy is working.

Regards,
Vlad

I managed to fix onboarding as it was urgent.
Thanks. I will let you know if I have another example, closing for now.