ClientQuery optional for commands
Summary: Some commands are run without a ClientQuery i.e. fetching devices. Nevertheless, this can be provide insights when problems take place. Reviewed By: antonk52 Differential Revision: D47795358 fbshipit-source-id: 0b7dc34475ae061f1b72843a087a798d305ed1c8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
544e49c097
commit
0ab1aeee78
@@ -33,15 +33,20 @@ class Recorder {
|
||||
|
||||
private handler_ = {
|
||||
cmd: (payload: CommandEventPayload) => {
|
||||
if (this.flipperServer && payload.context) {
|
||||
const clientQuery = payload.context as ClientQuery;
|
||||
if (this.flipperServer) {
|
||||
const clientQuery = payload.context as ClientQuery | undefined;
|
||||
|
||||
const device = clientQuery?.device ?? 'NONE';
|
||||
const app = clientQuery?.app ?? 'NONE';
|
||||
const medium = clientQuery?.medium ?? 'NONE';
|
||||
|
||||
const entry: CommandRecordEntry = {
|
||||
time: new Date(),
|
||||
type: 'cmd',
|
||||
device: clientQuery.device,
|
||||
app: clientQuery.app,
|
||||
device,
|
||||
app,
|
||||
message: payload.cmd,
|
||||
medium: clientQuery.medium,
|
||||
medium,
|
||||
cmd: payload.cmd,
|
||||
description: payload.description,
|
||||
success: payload.success,
|
||||
|
||||
Reference in New Issue
Block a user