Skip to content

Sync log rework#8

Open
Warhammer4000 wants to merge 2 commits into
ai-code-refactorfrom
sync-log-rework
Open

Sync log rework#8
Warhammer4000 wants to merge 2 commits into
ai-code-refactorfrom
sync-log-rework

Conversation

@Warhammer4000
Copy link
Copy Markdown

Reworked how log sync and software sync happens

Agent Gets data -> Stores in SQLite -> Attempts to send from SQLite to Supabase -> IF fail try again later from database.

Introduce a durable SQLite-backed audit log queue and wire it into the logging pipeline.

- Add internal/auditlogstore with schema and APIs (Open, Insert, GetPending, DeleteByIDs, Close) and a logHash/normalizeEventData implementation matching previous dedup behavior.
- Replace the in-memory LogBuffer with the persistent store in LoggingIntegration: collection, real-time subscription and shutdown now write/read from the SQLite queue; checkpoint and time-window logic updated to advance correctly.
- Add Uploader.UploadFromStore to batch-upload pending rows from the local store and delete successful rows; integrate final/force uploads to use the store.
- Remove the old in-memory buffer implementation and its tests (internal/logging/buffer.go and tests/logging_buffer_test.go); update comprehensive tests and .claude/settings.local.json entries.

Purpose: provide durable, deduplicated, retryable local persistence for audit logs so uploads survive restarts and can be retried safely.
Introduce a SQLite-backed SoftwareStore to persist software catalog state, reconcile fresh scans (upsert + mark uninstalled) and return the full catalog. Integrate the store into the scheduler and standalone software sync loop so scans are saved, non-fatal store errors are logged, and the full catalog (with first/last seen and is_active) is sent to the server. Improve browser extension collection by reading manifest.json files directly (handle i18n placeholders and single-item PowerShell JSON). Adjust API payload/types to include is_active, first_seen_at and last_seen_at and remove IconURL. Update tests and local .claude settings accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant