feat(web): space roles, upload queue with pipelined frames, background resume and faster sending
This commit is contained in:
1 parent
96c4335cb5
commit
a574583943
39 files changed
+1515
-194
No files matched your search
@@ -214,6 +214,8 @@ export async function signObjectDeletion(resource: SavedResource, session: Chann
|
||||
const { state } = await readDataKeys(resource, session);
|
||||
const object = state.objects.find(row => row.itemId === itemId);
|
||||
const signed = object?.event;
|
||||
// 末帧从未上传的对象没有签名清单:没有可签的内容,服务端允许作者和空间主直接删除
|
||||
if (object && !signed?.signature) return {};
|
||||
if (!signed?.manifestHash || !signed.frameCount || (object?.domain !== 'chat' && object?.domain !== 'files'))
|
||||
throw new Error('对象缺少已验签的密文清单,不能生成删除事件');
|
||||
const manifestHash = fromBase64Url(signed.manifestHash, 32);
|
||||
@@ -231,6 +233,8 @@ export async function verifyObjectDeletion(resource: SavedResource, session: Cha
|
||||
}
|
||||
const deleted = object?.deleteEvent;
|
||||
if (resource.mode === 'raw' && !deleted?.signature) return true;
|
||||
// 没传完的上传从未发布过有效内容,删掉它不需要事件(见 signObjectDeletion)
|
||||
if (object && !object.event?.signature && !deleted?.signature) return true;
|
||||
if (!object || !deleted?.signature || !deleted.eventId || !deleted.kind || !deleted.signerDeviceId
|
||||
|| !deleted.signerRootPublicKey || !deleted.signerDevicePublicKey || !deleted.deviceCertificateSignature
|
||||
|| !object.authorAccount || !object.event?.manifestHash || !object.event.frameCount || (object.domain !== 'chat' && object.domain !== 'files')) return false;
|
||||
|
||||
Reference in new issue
Block a user