Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2895531
D9077.id30772.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D9077.id30772.diff
View Options
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -508,6 +508,7 @@
updatesCurrentAsOf,
urlPrefix,
connection: defaultConnectionInfo,
+ lastCommunicatedPlatformDetails: null,
},
},
};
diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js
--- a/lib/reducers/keyserver-reducer.js
+++ b/lib/reducers/keyserver-reducer.js
@@ -1,6 +1,7 @@
// @flow
import reduceConnectionInfo from './connection-reducer.js';
+import reduceLastCommunicatedPlatformDetails from './last-communicated-platform-details-reducer.js';
import reduceUpdatesCurrentAsOf from './updates-reducer.js';
import { siweAuthActionTypes } from '../actions/siwe-actions.js';
import {
@@ -90,11 +91,19 @@
};
}
+ const lastCommunicatedPlatformDetails = reduceLastCommunicatedPlatformDetails(
+ state.keyserverInfos[ashoatKeyserverID].lastCommunicatedPlatformDetails,
+ action,
+ );
const connection = reduceConnectionInfo(
state.keyserverInfos[ashoatKeyserverID].connection,
action,
);
- if (connection !== state.keyserverInfos[ashoatKeyserverID].connection) {
+ if (
+ connection !== state.keyserverInfos[ashoatKeyserverID].connection ||
+ lastCommunicatedPlatformDetails !==
+ state.keyserverInfos[ashoatKeyserverID].lastCommunicatedPlatformDetails
+ ) {
state = {
...state,
keyserverInfos: {
@@ -102,6 +111,7 @@
[ashoatKeyserverID]: {
...state.keyserverInfos[ashoatKeyserverID],
connection,
+ lastCommunicatedPlatformDetails,
},
},
};
diff --git a/lib/types/keyserver-types.js b/lib/types/keyserver-types.js
--- a/lib/types/keyserver-types.js
+++ b/lib/types/keyserver-types.js
@@ -2,9 +2,10 @@
import t, { type TInterface } from 'tcomb';
+import type { PlatformDetails } from './device-types.js';
import { connectionInfoValidator } from './socket-types.js';
import type { ConnectionInfo } from './socket-types.js';
-import { tShape } from '../utils/validation-utils.js';
+import { tShape, tPlatformDetails } from '../utils/validation-utils.js';
// Once we start using the cookie field on web,
// the cookie field should be mandatory, of type ?string.
@@ -15,6 +16,7 @@
+updatesCurrentAsOf: number, // millisecond timestamp
+urlPrefix: string,
+connection: ConnectionInfo,
+ +lastCommunicatedPlatformDetails: ?PlatformDetails,
};
export type KeyserverStore = {
@@ -28,6 +30,7 @@
updatesCurrentAsOf: t.Number,
urlPrefix: t.String,
connection: connectionInfoValidator,
+ lastCommunicatedPlatformDetails: t.maybe(tPlatformDetails),
});
export const keyserverStoreValidator: TInterface<KeyserverStore> =
diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js
--- a/native/redux/redux-setup.js
+++ b/native/redux/redux-setup.js
@@ -128,6 +128,7 @@
updatesCurrentAsOf: 0,
urlPrefix: defaultURLPrefix,
connection: defaultConnectionInfo,
+ lastCommunicatedPlatformDetails: null,
},
},
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 5, 6:22 PM (21 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2244488
Default Alt Text
D9077.id30772.diff (3 KB)
Attached To
Mode
D9077: [keyserver][lib][native] Add lastCommunicatedPlatformDetails to keyserverStore
Attached
Detach File
Event Timeline
Log In to Comment