Skip to content

Improve startup.js

Lukas Eipert requested to merge leipert-improve-startup-js into master

What does this MR do?

This MR does multiple things:

  • Add specs for setupAxiosStartupCalls

    We are missing specs for setupAxiosStartupCalls, so this introduces them to test the current behavior

  • Stop delegating calls to startup if they failed

    fetch doesn't consider requests that have a status code outside of 200-299 to be a failure. So if our startup.js calls fail, we will actually cache that behavior and the later axios request which might have been successful will never have the chance to be successful.

  • Resolve startup.js call exactly once

    Currently we will always resolve to the same value, if the same URL is requested multiple times. This is unexpected, and we should only cache the first call.

  • Detach StartupJS interceptor after startup

    If all StartupJS calls have been made we can detach the interceptor.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Lukas Eipert

Merge request reports

Loading