Provide X-RateLimit-NearLimit header with 429 responses

XMLWordPrintable

      Issue Summary

      This is reproducible on Data Center: (yes) / (no)

      Steps to Reproduce

      1. Create a Forge UIKit app.
      2. Create a resolver function that calls an external URL in a 100x loop similar to the one below:
        resolver.define('fetchJsonplaceholder', async () => {
          console.log("Executing fetchJsonplaceholder");
          var respApi = undefined;  for (let i = 0; i <= 100; i++){
            try {
              //console.log("Inside Try block for simple FETCH request");
          
              var response = await fetchWithTimeout('https://jsonplaceholder.typicode.com/posts/1', {}, 5000);
              //console.log("After simple API execution");
          
              //const responseData = await response.json();
              //console.log("Simple API response", responseData);
              console.log(`i = ${i} - `, response.status);
              if (i > 95){
                console.log(response.headers);
                //console.log(response);
              }
              if (response.status == 429){
                console.log(response.headers);
                console.log(response);
              }
          
            } catch (error) {
              console.log("Caught error in outer block:", error);
            } 
          }
          return "test";
        });// code placeholder
        
      3. Run the app and observe the output logged by the console.log() statements.
      4. Observe that the Headers of the responses after the 95th call do not bring anything similar to x-ratelimit-nearlimit to point that the rate limit is close to be hit.

      Expected Results

      Headers of the responses should bring something similar to x-ratelimit-nearlimit to point that the rate limit is close to be hit.

      Actual Results

      Headers of the responses do NOT bring anything similar to x-ratelimit-nearlimit to point that the rate limit is close to be hit.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Gustavo Serrano (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: