Skip to content

Commit

Permalink
fix(webSockets): better backwards compat hack?
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Sep 7, 2022
1 parent 9defbb1 commit c92bee9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oada/services/http-handler/src/websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import { Responder } from '@oada/lib-kafka';

import type Change from '@oada/types/oada/change/v2.js';
import type SocketChange from '@oada/types/oada/websockets/change.js';
import type SocketResponse from '@oada/types/oada/websockets/response.js';
import type SocketRequest from '@oada/types/oada/websockets/request.js';
import type SocketResponse from '@oada/types/oada/websockets/response.js';
import type { WriteResponse } from '@oada/write-handler';
import {
// Runtime check for request type
Expand Down Expand Up @@ -86,7 +86,8 @@ class Watch {
async sendChange(change: SocketChange) {
trace({ change }, 'Sending change');
// HACK: for backwards compatibility with older clients
change.path_leftover = change.path_leftover ?? [];
change.path_leftover =
change.path_leftover ?? change.requestId.map(() => '');
await this.#send(JSON.stringify(change));
}

Expand Down

0 comments on commit c92bee9

Please sign in to comment.