@@ -24,23 +24,25 @@ import EventEmitter from 'eventemitter3';
2424import type { FastifyPluginAsync } from 'fastify' ;
2525import type LightMyRequest from 'light-my-request' ;
2626import type WebSocket from 'ws' ;
27- import fastifyWebsocket from '@fastify/websocket' ;
27+ import { default as fastifyWebsocket } from '@fastify/websocket' ;
2828import { is } from 'type-is' ;
2929import log from 'debug' ;
3030
3131import { OADAError } from '@oada/error' ;
3232
33- import { KafkaBase , Responder } from '@oada/lib-kafka' ;
3433import { changes , resources } from '@oada/lib-arangodb' ;
34+ import type { KafkaBase } from '@oada/lib-kafka' ;
35+ import { Responder } from '@oada/lib-kafka' ;
3536
36- import SocketRequest , {
37- // Runtime check for request type
38- assert as assertRequest ,
39- } from '@oada/types/oada/websockets/request.js' ;
4037import type Change from '@oada/types/oada/change/v2.js' ;
4138import type SocketChange from '@oada/types/oada/websockets/change.js' ;
4239import type SocketResponse from '@oada/types/oada/websockets/response.js' ;
40+ import type SocketRequest from '@oada/types/oada/websockets/request.js' ;
4341import type { WriteResponse } from '@oada/write-handler' ;
42+ import {
43+ // Runtime check for request type
44+ assert as assertRequest ,
45+ } from '@oada/types/oada/websockets/request.js' ;
4446
4547/**
4648 * @todo Actually figure out how "forgetting history" should work...
@@ -83,6 +85,8 @@ class Watch {
8385
8486 async sendChange ( change : SocketChange ) {
8587 trace ( { change } , 'Sending change' ) ;
88+ // HACK: for backwards compatibility with older clients
89+ change . path_leftover = change . path_leftover ?? [ ] ;
8690 await this . #send( JSON . stringify ( change ) ) ;
8791 }
8892
0 commit comments