• Jesus Martinez 29
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

We have an Apex method calling out a REST API Get method, which suddently started responding with binary data instead of JSON. We have not made any changes to the code in the REST API, and using tools like Postman, browser request or JS-fetch returns the appropriate JSON response.
Has anyone experience an issue like this? Other REST APIs do not have the same issue, but our prod, sandbox and scratch orgs all return the same corrupted response.
Here is a sample of the basic call we have in Apex:

@AuraEnabled
  public static String getEventById(String eventId) {
    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://RESTURI/' + eventId);
    request.setMethod('GET');
    request.setHeader('Content-Type', 'application/json');
    HttpResponse response = http.send(request);
    // Parse the JSON response
    if (response.getStatusCode() != 200) {
      System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus());
      return null;
    }
    return response.getBody();
  }

We are getting a status code 200, but the body of the response is just a lot of random binary data.

We're facing a challenge with our GitHub Actions CI setup, and we could use your insights to make it snappier.

Background: We recently updated to the latest Salesforce CLI version because of an installation error. But, since the switch, our CI pipeline has slowed down significantly.

The Issues:
  • Slow Package Installs: They used to be quick, but now they're taking forever.
  • Sluggish Scratch Org Creation: Creating scratch orgs isn't as snappy as it used to be.
  • Laggy Test Execution: Running tests inside scratch orgs has become a waiting game.
What We're Looking For:
  • Any tips or tricks you've used to speed up operations with the latest Salesforce CLI.
  • Have you dealt with similar slowdowns? How did you tackle them?
  • Are there ways to identify what's causing these slowdowns?
Our Setup:
  • GitHub Actions for CI/CD.
  • Running the latest Salesforce CLI.
  • Using Salesforce packages for dependencies.
Any help, advice, or shared experiences are much appreciated.

We have an Apex method calling out a REST API Get method, which suddently started responding with binary data instead of JSON. We have not made any changes to the code in the REST API, and using tools like Postman, browser request or JS-fetch returns the appropriate JSON response.
Has anyone experience an issue like this? Other REST APIs do not have the same issue, but our prod, sandbox and scratch orgs all return the same corrupted response.
Here is a sample of the basic call we have in Apex:

@AuraEnabled
  public static String getEventById(String eventId) {
    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://RESTURI/' + eventId);
    request.setMethod('GET');
    request.setHeader('Content-Type', 'application/json');
    HttpResponse response = http.send(request);
    // Parse the JSON response
    if (response.getStatusCode() != 200) {
      System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus());
      return null;
    }
    return response.getBody();
  }

We are getting a status code 200, but the body of the response is just a lot of random binary data.