mirror of
https://github.com/balzack/databag.git
synced 2025-05-05 07:55:15 +00:00
avoid unsealing unconfirmed topics
This commit is contained in:
parent
2103dd6ec6
commit
b4777e87b5
@ -414,14 +414,12 @@ export class FocusModule implements Focus {
|
|||||||
for (const asset of files) {
|
for (const asset of files) {
|
||||||
for (const transform of asset.transforms) {
|
for (const transform of asset.transforms) {
|
||||||
if (transform.type === TransformType.Thumb && transform.thumb) {
|
if (transform.type === TransformType.Thumb && transform.thumb) {
|
||||||
console.log("GET THUMB??");
|
|
||||||
const assetItem = {
|
const assetItem = {
|
||||||
assetId: `${assetItems.length}`,
|
assetId: `${assetItems.length}`,
|
||||||
encrytped: true,
|
encrytped: true,
|
||||||
hosting: HostingMode.Inline,
|
hosting: HostingMode.Inline,
|
||||||
inline: await transform.thumb(),
|
inline: await transform.thumb(),
|
||||||
}
|
}
|
||||||
console.log("GOT THUMB!!");
|
|
||||||
appAsset.push({appId: transform.appId, assetId: assetItem.assetId});
|
appAsset.push({appId: transform.appId, assetId: assetItem.assetId});
|
||||||
assetItems.push(assetItem);
|
assetItems.push(assetItem);
|
||||||
} else if (transform.type === TransformType.Copy) {
|
} else if (transform.type === TransformType.Copy) {
|
||||||
@ -591,7 +589,6 @@ console.log("GOT THUMB!!");
|
|||||||
await this.setRemoteChannelTopicSubject(topicId, type, updated);
|
await this.setRemoteChannelTopicSubject(topicId, type, updated);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("THROWING!");
|
|
||||||
this.log.error(err);
|
this.log.error(err);
|
||||||
await this.removeRemoteChannelTopic(topicId);
|
await this.removeRemoteChannelTopic(topicId);
|
||||||
throw new Error('failed to add topic');
|
throw new Error('failed to add topic');
|
||||||
@ -866,7 +863,7 @@ console.log("THROWING!");
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async unsealTopicDetail(item: TopicItem): Promise<boolean> {
|
private async unsealTopicDetail(item: TopicItem): Promise<boolean> {
|
||||||
if (item.detail.sealed && !item.unsealedDetail && this.sealEnabled && this.channelKey && this.crypto) {
|
if (item.detail.status === 'confirmed' && item.detail.sealed && !item.unsealedDetail && this.sealEnabled && this.channelKey && this.crypto) {
|
||||||
try {
|
try {
|
||||||
const { messageEncrypted, messageIv } = item.detail.data;
|
const { messageEncrypted, messageIv } = item.detail.data;
|
||||||
if (!messageEncrypted || !messageIv) {
|
if (!messageEncrypted || !messageIv) {
|
||||||
|
@ -657,7 +657,7 @@ export class StreamModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async unsealChannelSummary(channelId: string, item: ChannelItem): Promise<boolean> {
|
private async unsealChannelSummary(channelId: string, item: ChannelItem): Promise<boolean> {
|
||||||
if (item.unsealedSummary == null && item.summary.dataType === 'sealedtopic' && this.seal && this.crypto) {
|
if (item.unsealedSummary == null && item.summary.status === 'confirmed' && item.summary.dataType === 'sealedtopic' && this.seal && this.crypto) {
|
||||||
try {
|
try {
|
||||||
if (!item.channelKey) {
|
if (!item.channelKey) {
|
||||||
const { seals } = JSON.parse(item.detail.data);
|
const { seals } = JSON.parse(item.detail.data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user