title: SignalR the new message does not shows in target client's message box - Angular
body: <p>I've created a chat system and now I'm trying to implement it by SignalR but the new message doesn't show in the target client's message box. It just happen after sending a new message to the server. However the new message and old messages shows correctly in the sender's browser</p>
  <p>Here is my code:</p>
  <pre><code>baseUrl = environment.apiUrl;
  hubUrl = environment.hubUrl;
  private hubConnection: HubConnection;
  private messageThreadSource = new BehaviorSubject&lt;Message[]&gt;([]);
  messageThread$ = this.messageThreadSource.asObservable();
  
  constructor(private http: HttpClient) { }
  
  
  createHubConnection(userToken: UserToken, otherUserId: string, skip: string) {
   this.hubConnection = new HubConnectionBuilder()
     .withUrl(this.hubUrl + 'message?targetUserId=' + otherUserId + '&amp;&amp;skip=' + skip, {
       accessTokenFactory: () =&gt; userToken.token
     })
   .withAutomaticReconnect()
   .build()
  
  this.hubConnection
    .start()
    .catch(error =&gt; console.log(&quot;SignalR Message Error : &quot;, error));
  
  this.hubConnection.on(&quot;ReceiveMessageThread&quot;, messages =&gt; {
    this.messageThreadSource.next(messages);
  });
  
  this.hubConnection.on(&quot;NewMessage&quot;, message =&gt; {
    this.messageThread$.pipe(take(1)).subscribe(messages =&gt; {
      this.messageThreadSource.next([...messages,message]);
    })
  });
  
  
  }
  </code></pre>
  <p>To explain more there is value in both <code>message</code> and <code>messages</code> in the <code>NewMessage</code> hub connection. Having said that if I only pass <code>message</code>, the target client's message box will become empty, I mean all the previous message eliminate from the HTML and at the same time only the latest message will show up in the sender client's message box.</p>
  <pre><code>this.messageThreadSource.next([message]);
  </code></pre>