diff --git a/platforms/cerberus/src/web3adapter/watchers/subscriber.ts b/platforms/cerberus/src/web3adapter/watchers/subscriber.ts index c16e17c8..68d1ced9 100644 --- a/platforms/cerberus/src/web3adapter/watchers/subscriber.ts +++ b/platforms/cerberus/src/web3adapter/watchers/subscriber.ts @@ -181,7 +181,8 @@ export class PostgresSubscriber implements EntitySubscriberInterface { // For Message entities, only process if they are system messages if (tableName === "messages") { // Check if this is a system message (starts with $$system-message$$) - const isSystemMessage = data.content && typeof data.content === 'string' && data.content.startsWith('$$system-message$$'); + const isSystemMessage = data.text && data.text.includes('$$system-message$$'); + if (!isSystemMessage) { console.log("📝 Skipping non-system message:", data.id); diff --git a/platforms/evoting-api/src/web3adapter/watchers/subscriber.ts b/platforms/evoting-api/src/web3adapter/watchers/subscriber.ts index 03cf487a..a58a4159 100644 --- a/platforms/evoting-api/src/web3adapter/watchers/subscriber.ts +++ b/platforms/evoting-api/src/web3adapter/watchers/subscriber.ts @@ -305,8 +305,7 @@ export class PostgresSubscriber implements EntitySubscriberInterface { // For Message entities, only process if they are system messages if (tableName === "messages") { - // Check if this is a system message (starts with $$system-message$$) - const isSystemMessage = data.content && typeof data.content === 'string' && data.content.startsWith('$$system-message$$'); + const isSystemMessage = data.text && data.text.includes('$$system-message$$'); if (!isSystemMessage) { console.log("📝 Skipping non-system message:", data.id);