Skip to content

Commit 6bea83f

Browse files
authored
Fix/message spam (#313)
* chore: attmept to fix message spam * chore: fix system messages issue
1 parent cb3eae3 commit 6bea83f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

platforms/cerberus/src/web3adapter/watchers/subscriber.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ export class PostgresSubscriber implements EntitySubscriberInterface {
181181
// For Message entities, only process if they are system messages
182182
if (tableName === "messages") {
183183
// Check if this is a system message (starts with $$system-message$$)
184-
const isSystemMessage = data.content && typeof data.content === 'string' && data.content.startsWith('$$system-message$$');
184+
const isSystemMessage = data.text && data.text.includes('$$system-message$$');
185+
185186

186187
if (!isSystemMessage) {
187188
console.log("📝 Skipping non-system message:", data.id);

platforms/evoting-api/src/web3adapter/watchers/subscriber.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ export class PostgresSubscriber implements EntitySubscriberInterface {
305305

306306
// For Message entities, only process if they are system messages
307307
if (tableName === "messages") {
308-
// Check if this is a system message (starts with $$system-message$$)
309-
const isSystemMessage = data.content && typeof data.content === 'string' && data.content.startsWith('$$system-message$$');
308+
const isSystemMessage = data.text && data.text.includes('$$system-message$$');
310309

311310
if (!isSystemMessage) {
312311
console.log("📝 Skipping non-system message:", data.id);

0 commit comments

Comments
 (0)