diff --git a/app/core/background/indexer_service.py b/app/core/background/indexer_service.py index 359a721..8bf5788 100644 --- a/app/core/background/indexer_service.py +++ b/app/core/background/indexer_service.py @@ -126,13 +126,13 @@ async def indexer_loop(platform_found: bool, seqno: int) -> [bool, int]: encrypted_stored_content.owner_address = item_owner_address.to_string(1, 1, 1) if user_wallet_connection: encrypted_stored_content.user_id = user_wallet_connection.user_id - # elif encrypted_stored_content.type.startswith('onchain') and encrypted_stored_content.onchain_index == item_index: - # encrypted_stored_content.type = "onchain/content" + ("_unknown" if not (encrypted_stored_content.key_id is None) else "") - # encrypted_stored_content.owner_address = item_owner_address.to_string(1, 1, 1) - # if user_wallet_connection: - # encrypted_stored_content.user_id = user_wallet_connection.user_id + elif encrypted_stored_content.type.startswith('onchain') and encrypted_stored_content.onchain_index == item_index: + encrypted_stored_content.type = "onchain/content" + ("_unknown" if not (encrypted_stored_content.key_id is None) else "") + encrypted_stored_content.owner_address = item_owner_address.to_string(1, 1, 1) + if user_wallet_connection: + encrypted_stored_content.user_id = user_wallet_connection.user_id else: - make_log("Indexer", f"Item already indexed and not local: {item_content_hash_str}", level="error") + make_log("Indexer", f"[CRITICAL] Item already indexed and ERRORED!: {item_content_hash_str}", level="error") return platform_found, seqno encrypted_stored_content.updated = datetime.now() @@ -144,7 +144,7 @@ async def indexer_loop(platform_found: bool, seqno: int) -> [bool, int]: else: item_metadata_packed['copied_from'] = encrypted_stored_content.id item_metadata_packed['copied_from_cid'] = encrypted_stored_content.cid.serialize_v2() - item_content_hash_str = f"IGNORED_DUPLICATE_{b58encode(os.urandom(30)).decode()}" # check this for vulnerability + item_content_hash_str = f"{b58encode(bytes(16) + os.urandom(30)).decode()}" # check this for vulnerability onchain_stored_content = StoredContent( type="onchain/content_unknown",