Modify client id string and device serialisation
Summary: This improves bug reports. Adding serial into device.toJson() means you can now easily see which clients (apps) are from which device because they both contain the serial. Changing client id to use # instead of - because the subcomponents of it already use -. Reviewed By: passy Differential Revision: D13058430 fbshipit-source-id: 02697ec623829423e667fd2acbd1abc369a6919b
This commit is contained in:
committed by
Facebook Github Bot
parent
9f13e1422b
commit
a48c680a40
@@ -66,7 +66,7 @@ export default class BaseDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return `<${this.constructor.name}#${this.title}>`;
|
return `<${this.constructor.name}#${this.title}#${this.serial}>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown() {}
|
teardown() {}
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ export default class Server extends EventEmitter {
|
|||||||
addConnection(conn: ReactiveSocket, query: ClientQuery): Client {
|
addConnection(conn: ReactiveSocket, query: ClientQuery): Client {
|
||||||
invariant(query, 'expected query');
|
invariant(query, 'expected query');
|
||||||
|
|
||||||
const id = `${query.app}-${query.os}-${query.device}-${query.device_id}`;
|
const id = `${query.app}#${query.os}#${query.device}#${query.device_id}`;
|
||||||
console.debug(`Device connected: ${id}`, 'server');
|
console.debug(`Device connected: ${id}`, 'server');
|
||||||
|
|
||||||
const client = new Client(id, query, conn, this.logger, this.store);
|
const client = new Client(id, query, conn, this.logger, this.store);
|
||||||
|
|||||||
Reference in New Issue
Block a user