Page MenuHomePhabricator

D12617.id41898.diff
No OneTemporary

D12617.id41898.diff

diff --git a/lib/tunnelbroker/secondary-tunnelbroker-connection.js b/lib/tunnelbroker/secondary-tunnelbroker-connection.js
--- a/lib/tunnelbroker/secondary-tunnelbroker-connection.js
+++ b/lib/tunnelbroker/secondary-tunnelbroker-connection.js
@@ -2,17 +2,26 @@
import type { MessageToDeviceRequest } from '../types/tunnelbroker/message-to-device-request-types.js';
import type { MessageToTunnelbrokerRequest } from '../types/tunnelbroker/message-to-tunnelbroker-request-types.js';
+import type { TunnelbrokerAPNsNotif } from '../types/tunnelbroker/notif-types.js';
type RemoveCallback = () => void;
export type SecondaryTunnelbrokerConnection = {
// Used by an inactive tab to send messages
+sendMessage: (
- MessageToDeviceRequest | MessageToTunnelbrokerRequest,
+ message:
+ | MessageToDeviceRequest
+ | MessageToTunnelbrokerRequest
+ | TunnelbrokerAPNsNotif,
) => mixed,
// Active tab receives messages from inactive tabs
+onSendMessage: (
- (MessageToDeviceRequest | MessageToTunnelbrokerRequest) => mixed,
+ (
+ message:
+ | MessageToDeviceRequest
+ | MessageToTunnelbrokerRequest
+ | TunnelbrokerAPNsNotif,
+ ) => mixed,
) => RemoveCallback,
// Active tab sets the message status of messages from inactive tabs
diff --git a/lib/tunnelbroker/tunnelbroker-context.js b/lib/tunnelbroker/tunnelbroker-context.js
--- a/lib/tunnelbroker/tunnelbroker-context.js
+++ b/lib/tunnelbroker/tunnelbroker-context.js
@@ -20,6 +20,7 @@
tunnelbrokerMessageTypes,
tunnelbrokerMessageValidator,
} from '../types/tunnelbroker/messages.js';
+import type { TunnelbrokerAPNsNotif } from '../types/tunnelbroker/notif-types.js';
import type {
AnonymousInitializationMessage,
ConnectionInitializationMessage,
@@ -60,6 +61,7 @@
message: TunnelbrokerClientMessageToDevice,
messageID: ?string,
) => Promise<void>,
+ +sendNotif: (notif: TunnelbrokerAPNsNotif) => Promise<void>,
+sendMessageToTunnelbroker: (payload: string) => Promise<void>,
+addListener: (listener: TunnelbrokerSocketListener) => void,
+removeListener: (listener: TunnelbrokerSocketListener) => void,
@@ -311,7 +313,10 @@
]);
const sendMessageToDeviceRequest: (
- request: MessageToDeviceRequest | MessageToTunnelbrokerRequest,
+ request:
+ | MessageToDeviceRequest
+ | MessageToTunnelbrokerRequest
+ | TunnelbrokerAPNsNotif,
) => Promise<void> = React.useCallback(
request => {
return new Promise((resolve, reject) => {
@@ -436,6 +441,7 @@
() => ({
sendMessage,
sendMessageToTunnelbroker,
+ sendNotif: sendMessageToDeviceRequest,
socketState,
addListener,
removeListener,
@@ -443,6 +449,7 @@
}),
[
sendMessage,
+ sendMessageToDeviceRequest,
sendMessageToTunnelbroker,
socketState,
addListener,

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 9:25 AM (16 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590020
Default Alt Text
D12617.id41898.diff (2 KB)

Event Timeline