title: Spartacus duplicated cart merge request
body: <p>I'm having some problems with duplicated requests to cart merge API when a user logs in.</p>
  <p>Looking at Spartacus code, I've noticed the request comes from a subscription from ActiveCartService, which watches for user id changes. This subscription is made in the service constructor.</p>
  <pre><code>    constructor(
      protected store: Store&lt;StateWithMultiCart&gt;,
      protected multiCartService: MultiCartService,
      protected userIdService: UserIdService
    ) {
      this.initActiveCart();
    }
  </code></pre>
  <pre><code>  protected initActiveCart() {
  // Any change of user id is also interesting for us, because we have to merge/load/switch cart in those cases.
  this.subscription.add(
    this.userIdService
      .getUserId()
      .pipe(
        // We never trigger cart merge/load on app initialization here and that's why we wait with pairwise for a change of userId (not initialization).
        pairwise(),
        switchMap(([previousUserId, userId]) =&gt;
          // We need cartId once we have the previous and current userId. We don't want to subscribe to cartId stream before.
          combineLatest([
            of(previousUserId),
            of(userId),
            this.activeCartId$,
          ]).pipe(take(1))
        )
      )
      .subscribe(([previousUserId, userId, cartId]) =&gt; {
        // Only change of user and not a logout (current user id !== anonymous) should trigger loading mechanism
        if (this.isJustLoggedIn(userId, previousUserId)) {
          this.loadOrMerge(cartId, userId, previousUserId);
        }
      })
  );
  </code></pre>
  <p>The problem is, spartacus-tua-spa library extends this service twice, and so creates two instances of the ActiveCartService, therefore two watches for user id changes and two requests for cart merge API.</p>
  <pre><code>export class TmaActiveCartService extends ActiveCartService {
  
  export class TmaCartService extends ActiveCartService {
  </code></pre>
  <p>Is there any fix or update for this behavior?</p>
  <p>I'm using spartacus@3.4.6 and spartacus/tua-spa@3.1</p>