Prevent duplicate subscription calls when using result hook

Issue

When using the result hook to initiate a subscription, the hook has the ability to fire multiple times (refetches etc.). This leads to redundant subscription calls. subscribeToMore hook would be the solution but it's a little buggy with race conditions.

I.E it fires sometimes before data is present and doesn't really respect the skip hook in all use cases.

Solution

Add a isSubscribed flag to track if the subscription is active already or not to prevent duplicate calls.

This should be done in the following components:

  1. app/assets/javascripts/ci/pipeline_details/header/pipeline_header.vue
  2. app/assets/javascripts/repository/components/last_commit.vue

An example of how to do this can be seen in the MR: !202263 (merged)

Edited by Payton Burdette