repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Uniformize log messages format
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
UIServiceWorkerBroadcastChannel.ts
diff --git
a/src/charging-station/UIServiceWorkerBroadcastChannel.ts
b/src/charging-station/UIServiceWorkerBroadcastChannel.ts
index e921972d4c183d7dd5d86fc611de8d5a656ab8ab..c64a7ccc2212d021189b373278ad8d5a804961bc 100644
(file)
--- a/
src/charging-station/UIServiceWorkerBroadcastChannel.ts
+++ b/
src/charging-station/UIServiceWorkerBroadcastChannel.ts
@@
-1,6
+1,7
@@
-import { BroadcastChannelResponse, MessageEvent } from '../types/WorkerBroadcastChannel';
+import type { ResponsePayload } from '../types/UIProtocol';
+import type { BroadcastChannelResponse, MessageEvent } from '../types/WorkerBroadcastChannel';
import logger from '../utils/Logger';
import logger from '../utils/Logger';
-import AbstractUIService from './ui-server/ui-services/AbstractUIService';
+import
type
AbstractUIService from './ui-server/ui-services/AbstractUIService';
import WorkerBroadcastChannel from './WorkerBroadcastChannel';
const moduleName = 'UIServiceWorkerBroadcastChannel';
import WorkerBroadcastChannel from './WorkerBroadcastChannel';
const moduleName = 'UIServiceWorkerBroadcastChannel';
@@
-19,9
+20,12
@@
export default class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChan
if (this.isRequest(messageEvent.data)) {
return;
}
if (this.isRequest(messageEvent.data)) {
return;
}
+ this.validateMessageEvent(messageEvent);
const [uuid, responsePayload] = messageEvent.data as BroadcastChannelResponse;
const [uuid, responsePayload] = messageEvent.data as BroadcastChannelResponse;
+ // TODO: handle multiple responses for the same uuid
+ delete responsePayload.hashId;
- this.uiService.sendResponse(uuid, responsePayload);
+ this.uiService.sendResponse(uuid, responsePayload
as ResponsePayload
);
}
private messageErrorHandler(messageEvent: MessageEvent): void {
}
private messageErrorHandler(messageEvent: MessageEvent): void {