Refactor handle registry updates and improve key decoding
Removed 'healing' logic and authoritative update propagation from handle registry and gossip code, simplifying handle upserts to only update on strictly newer timestamps. Enhanced sodium-chat key handling with robust base64 decoding and key repair logic. Added scripts for key inspection and crypto testing. Deleted unused healing module.
This commit is contained in:
@@ -3,7 +3,6 @@ import { db } from '@/db';
|
||||
import { chatDeviceBundles, handleRegistry, remoteIdentityCache } from '@/db/schema';
|
||||
import { requireAuth } from '@/lib/auth';
|
||||
import { eq, and, gt } from 'drizzle-orm';
|
||||
import { updateRegistryFromProfile } from '@/lib/swarm/healing';
|
||||
|
||||
/**
|
||||
* GET /api/chat/keys?did=<did>
|
||||
@@ -116,9 +115,6 @@ export async function GET(request: NextRequest) {
|
||||
if (chatKey) {
|
||||
console.log('[Chat Keys GET] Found key in Swarm Profile');
|
||||
|
||||
// HEALING: Update the registry because we found the user at this nodeDomain!
|
||||
await updateRegistryFromProfile(handleEntry.handle, did, nodeDomain);
|
||||
|
||||
// Cache it
|
||||
await db.insert(remoteIdentityCache).values({
|
||||
did: did,
|
||||
|
||||
Reference in New Issue
Block a user