priority FBJS updates

pull/1200/head
gabrielburnworth 2019-05-17 13:14:01 -07:00
parent 485137cafa
commit d3f7cc63d5
4 changed files with 11 additions and 5 deletions

View File

@ -12,7 +12,9 @@ export const ACTIVE_THRESHOLD = PING_INTERVAL * 2;
const label = "ping";
export const LAST_IN: keyof FarmBotInternalConfig = "LAST_PING_IN";
export const LAST_OUT: keyof FarmBotInternalConfig = "LAST_PING_OUT";
export const PING: Readonly<RpcRequest> = { kind: "rpc_request", args: { label } };
export const PING: Readonly<RpcRequest> = {
kind: "rpc_request", args: { label, priority: 0 }
};
type Direction = "in" | "out";

View File

@ -1,5 +1,6 @@
const mockDevice = {
send: jest.fn(() => { return Promise.resolve(); }),
send: jest.fn(() => Promise.resolve()),
rpcShim: jest.fn(() => Promise.resolve()),
};
jest.mock("../../../device", () => ({

View File

@ -1,6 +1,7 @@
import { Farmbot, rpcRequest } from "farmbot";
import { Farmbot } from "farmbot";
import { createTransferCert } from "./create_transfer_cert";
import { toPairs } from "../../util";
import { getDevice } from "../../device";
export interface TransferProps {
email: string;
@ -14,7 +15,9 @@ export async function transferOwnership(input: TransferProps): Promise<void> {
try {
const secret = await createTransferCert(input);
const body = toPairs({ email, secret });
await device.send(rpcRequest([{ kind: "change_ownership", args: {}, body }]));
await device.send(getDevice().rpcShim([{
kind: "change_ownership", args: {}, body
}]));
return Promise.resolve();
} catch (error) {
return Promise.reject(error);

View File

@ -43,7 +43,7 @@
"coveralls": "3.0.3",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "1.13.0",
"farmbot": "7.1.0",
"farmbot": "8.0.0-rc1",
"farmbot-toastr": "1.0.3",
"i18next": "15.1.1",
"jest": "24.8.0",