Fix Vue property conflicts in PlatformServiceMixin implementation

- Remove duplicate property declarations from TopMessage component
- Use (this as any) type assertion for mixin methods
- Resolves 'Data property already defined' warnings
- Fixes 'this.dbQuery is not a function' runtime errors
This commit is contained in:
Matthew Raymer
2025-07-02 09:58:07 +00:00
parent 7b1f891c63
commit b37f1d1d84
11 changed files with 446 additions and 158 deletions

View File

@@ -182,7 +182,7 @@ export async function logToDb(
message: string,
level: string = "info",
): Promise<void> {
// Prevent infinite logging loops - if we're already trying to log to database,
// Prevent infinite logging loops - if we're already trying to log to database,
// just log to console instead to break circular dependency
if (isLoggingToDatabase) {
console.log(`[DB-PREVENTED-${level.toUpperCase()}] ${message}`);
@@ -210,12 +210,21 @@ export async function logToDb(
const sevenDaysAgo = new Date(
new Date().getTime() - 7 * 24 * 60 * 60 * 1000,
).toDateString(); // Use date string to match schema
memoryLogs = memoryLogs.filter((log) => log.split(" ")[0] > sevenDaysAgo);
await platform.dbExec("DELETE FROM logs WHERE date < ?", [sevenDaysAgo]);
memoryLogs = memoryLogs.filter(
(log) => log.split(" ")[0] > sevenDaysAgo,
);
await platform.dbExec("DELETE FROM logs WHERE date < ?", [
sevenDaysAgo,
]);
lastCleanupDate = todayKey;
}
} catch (error) {
console.error("Error logging to database:", error, " ... for original message:", message);
console.error(
"Error logging to database:",
error,
" ... for original message:",
message,
);
}
} finally {
// Always reset the flag to prevent permanent blocking of database logging