mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-16 11:23:13 +00:00
- Added @waku/sds dependency - Created MinimalSDSWrapper for basic causal ordering - Enhanced vote messages with SDS metadata (Lamport timestamps, causal history) - Updated MessageManager to use SDS for vote conflict resolution - Added SDS status indicator in header - Added debug logging for SDS operations This is a minimal proof-of-concept that: - Uses a single SDS channel for all votes - Only applies to vote messages (other message types unchanged) - Maintains backward compatibility - Can be disabled by removing the SDS enhancement
21 lines
532 B
TypeScript
21 lines
532 B
TypeScript
// Simple debug logger for SDS operations
|
|
export const SDSDebug = {
|
|
enabled: true,
|
|
|
|
log(message: string, data?: any) {
|
|
if (!this.enabled) return;
|
|
|
|
const timestamp = new Date().toISOString().split('T')[1].split('.')[0];
|
|
const prefix = `[SDS ${timestamp}]`;
|
|
|
|
if (data) {
|
|
console.log(`${prefix} ${message}`, data);
|
|
} else {
|
|
console.log(`${prefix} ${message}`);
|
|
}
|
|
},
|
|
|
|
logVote(action: string, voteKey: string, data?: any) {
|
|
this.log(`VOTE ${action} - ${voteKey}`, data);
|
|
}
|
|
}; |