-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client server delete devices #144
Conversation
… before uiauthenticate, changed uiauthenticate to prevent obsolete jsoncontent call, added typecheckers
…ages deletion by batches of 10, finished delete_devices endpoint
insertDeletedPushersPromises = pushers.map(async (pusher) => { | ||
await limit(() => | ||
clientServer.matrixDb.insert('deleted_pushers', { | ||
stream_id: randomString(64), // TODO: Update when stream ordering is implemented since the stream_id has to keep track of the order of operations |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
userId | ||
) | ||
const deleteDeviceInboxPromises = devices.map((deviceId) => { | ||
return limit(() => deleteDeviceInbox(clientServer, userId, deviceId, 1000)) // TODO : Fix the upToStreamId when stream ordering is implemented. It should be set to avoid deleting non delivered messages |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
return hash.ready.then(() => { | ||
return clientServer.matrixDb.insert('users', { | ||
...commonUserData, | ||
password_hash: hash.sha256(password) // TODO: Handle other hashing algorithms |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
.then((deviceRows) => { | ||
let initial_device_display_name | ||
if (deviceRows.length > 0) { | ||
// TODO : Refresh access tokens using refresh tokens and invalidate the previous access_token associated with the device after implementing the /refresh endpoint |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
creation_time: epoch(), | ||
clientdict: JSON.stringify(obj), | ||
serverdict: JSON.stringify({}), | ||
uri: req.url as string, // TODO : Ensure this is the right way to get the URI |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
Added endpoint from the spec : https://spec.matrix.org/v1.11/client-server-api/#post_matrixclientv3delete_devices
Added function to get maxStreamIds from batches of 10
Added typecheckers to check the content of the request body before inserting it in the db during UI Auth.
Modified endpoints that use UI-Auth to add those type checks.
Removed redundant jsonContent call in UI Auth (already called to check the request body right before).
Also added the following endpoint from the spec : https://spec.matrix.org/v1.11/client-server-api/#delete_matrixclientv3devicesdeviceid
which is a particular case of the previous.
Moved the tests of the /devices endpoints to a new file devices.test.ts for clarity.