Page MenuHomePhabricator

D13038.id43581.diff
No OneTemporary

D13038.id43581.diff

diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -75,7 +75,7 @@
import type { RawThreadInfos } from '../types/thread-types.js';
import {
userActionsP2PMessageTypes,
- type PrimaryDeviceLogoutP2PMessage,
+ type DeviceLogoutP2PMessage,
type SecondaryDeviceLogoutP2PMessage,
} from '../types/tunnelbroker/user-actions-peer-to-peer-message-types.js';
import type {
@@ -282,8 +282,8 @@
throw new Error('Used primary device logout on a non-primary device');
}
- const messageContents: PrimaryDeviceLogoutP2PMessage = {
- type: userActionsP2PMessageTypes.LOG_OUT_PRIMARY_DEVICE,
+ const messageContents: DeviceLogoutP2PMessage = {
+ type: userActionsP2PMessageTypes.LOG_OUT_DEVICE,
};
const recipients = secondaryDevices.map(deviceID => ({ userID, deviceID }));
await broadcastEphemeralMessage(
diff --git a/lib/tunnelbroker/use-peer-to-peer-message-handler.js b/lib/tunnelbroker/use-peer-to-peer-message-handler.js
--- a/lib/tunnelbroker/use-peer-to-peer-message-handler.js
+++ b/lib/tunnelbroker/use-peer-to-peer-message-handler.js
@@ -96,8 +96,7 @@
const userActionMessage: UserActionP2PMessage = parsedMessageToDevice;
if (
- userActionMessage.type ===
- userActionsP2PMessageTypes.LOG_OUT_PRIMARY_DEVICE
+ userActionMessage.type === userActionsP2PMessageTypes.LOG_OUT_DEVICE
) {
// causes log out, there is no need to remove Inbound P2P message
void dispatchActionPromise(
diff --git a/lib/types/tunnelbroker/user-actions-peer-to-peer-message-types.js b/lib/types/tunnelbroker/user-actions-peer-to-peer-message-types.js
--- a/lib/types/tunnelbroker/user-actions-peer-to-peer-message-types.js
+++ b/lib/types/tunnelbroker/user-actions-peer-to-peer-message-types.js
@@ -6,18 +6,18 @@
import { type DMOperation, dmOperationValidator } from '../dm-ops.js';
export const userActionsP2PMessageTypes = Object.freeze({
- LOG_OUT_PRIMARY_DEVICE: 'LOG_OUT_PRIMARY_DEVICE',
+ LOG_OUT_DEVICE: 'LOG_OUT_DEVICE',
LOG_OUT_SECONDARY_DEVICE: 'LOG_OUT_SECONDARY_DEVICE',
ACCOUNT_DELETION: 'ACCOUNT_DELETION',
DM_OPERATION: 'DM_OPERATION',
});
-export type PrimaryDeviceLogoutP2PMessage = {
- +type: 'LOG_OUT_PRIMARY_DEVICE',
+export type DeviceLogoutP2PMessage = {
+ +type: 'LOG_OUT_DEVICE',
};
-export const primaryDeviceLogoutP2PMessageValidator: TInterface<PrimaryDeviceLogoutP2PMessage> =
- tShape<PrimaryDeviceLogoutP2PMessage>({
- type: tString(userActionsP2PMessageTypes.LOG_OUT_PRIMARY_DEVICE),
+export const deviceLogoutP2PMessageValidator: TInterface<DeviceLogoutP2PMessage> =
+ tShape<DeviceLogoutP2PMessage>({
+ type: tString(userActionsP2PMessageTypes.LOG_OUT_DEVICE),
});
export type SecondaryDeviceLogoutP2PMessage = {
@@ -48,14 +48,14 @@
});
export type UserActionP2PMessage =
- | PrimaryDeviceLogoutP2PMessage
+ | DeviceLogoutP2PMessage
| SecondaryDeviceLogoutP2PMessage
| AccountDeletionP2PMessage
| DMOperationP2PMessage;
export const userActionP2PMessageValidator: TUnion<UserActionP2PMessage> =
t.union([
- primaryDeviceLogoutP2PMessageValidator,
+ deviceLogoutP2PMessageValidator,
secondaryDeviceLogoutP2PMessageValidator,
accountDeletionP2PMessageValidator,
dmOperationP2PMessageValidator,

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 10:29 AM (18 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2560313
Default Alt Text
D13038.id43581.diff (3 KB)

Event Timeline