Skip to content

Feature/slog - #106

Open
SugeethJSA wants to merge 3 commits into
lugvitc:masterfrom
SugeethJSA:feature/logcat
Open

Feature/slog#106
SugeethJSA wants to merge 3 commits into
lugvitc:masterfrom
SugeethJSA:feature/logcat

Conversation

@SugeethJSA

Copy link
Copy Markdown

S log implemented pls check, no logcat.

- Added centralized logging system with logcat for structured log entries.
- Introduced log viewer screen in the frontend to display live log output.
- Enhanced error handling in API to emit errors to the frontend.
- Implemented reconnect logic with exponential backoff on disconnect.
- Purged empty contact stubs during app state resync to clean up the database.
- Improved app state synchronization for contacts and added logging for diagnostics.
- Updated frontend to handle reconnect notifications and display error messages.
@celestix

Copy link
Copy Markdown
Collaborator

Required changes — release blocker

Reviewed head: f554c63bcf46fbffab50bc238f660cfca3f45432.

  • api/api.go:396-402: 🔴 Requests "sqlite" while the retained mattn driver registers "sqlite3"; application startup fails. Restore "sqlite3" and add an actual startup test.
  • api/api.go:190-216,631-635: 🔴 Custom reconnect competes with whatsmeow's built-in reconnect and can repeatedly observe ErrAlreadyConnected while exposing a false disconnected state. Use whatsmeow's reconnect/status hooks as the single authority.
  • api/api.go:168-180: 🔴 Purge targets nonexistent nick_name, bypasses the store/cache lifecycle, and mutates dependency-owned schema. Remove the purge; manage application-owned contact state through public store APIs and canonical JIDs.
  • api/api.go contact handler: 🟡 Full-sync updates fan out one Wails event/frontend refresh per contact. Skip incremental emissions for FromFullSync and emit one coalesced snapshot-complete event.
  • api/contact.go:44-47: 🔴 One unknown participant aborts the entire group response. Return a fallback participant DTO and continue collecting the group.
  • HistorySync handler: 🟡 Starts a goroutine for each batch without ordering or bounded backpressure. Route batches through one cancellable serialized processor.
  • logging: 🟡 Eager fmt formatting defeats structured logging, duplicates records, and exposes raw JIDs/paths. Pass structured attributes lazily and redact identifiers.
  • frontend reconnect notifications: 🟡 Notification IDs/listeners can be overwritten and leaked. Keep one stable subscription and unsubscribe with the exact registered callback.
  • tests: 🔴 No tests were added; passing package tests do not execute Startup, reconnect races, full-sync fan-out, or unknown-participant handling. Add these tests before re-review.

The standard-library slog direction is acceptable and does not add a logcat dependency. Extract it into a small logging-only PR after removing the unrelated database/reconnect/contact behavior.

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.

2 participants