Skip to content

Address review feedback on initial draft; align logging with matterclient - #2

Merged
hloeung merged 3 commits into
masterfrom
copilot/update-logging-and-fix-issues
Oct 11, 2026
Merged

hloeung merged 3 commits into
masterfrom
copilot/update-logging-and-fix-issues

Conversation

Copilot AI commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Addresses the six Copilot review comments on the initial draft (#1) and makes logging consistent with matterclient, using logrus with the matterbridge/logrus-prefixed-formatter.

  • Ready / handler serialization

    • Ready is no longer fired from a separate timer goroutine. A readySyncer wrapper around DefaultSyncer calls it once, on the sync goroutine, after the first sync response has been fully processed.
    • This keeps Ready, OnMessage and OnReaction serialized as the Handler contract says.
  • Direct rooms

    • SendDirect now persists the updated m.direct account data via SetAccountData. Previously the new room existed only in memory, so a relogin could create a duplicate.
    • If persisting fails, the error is logged and the message is still sent. Returning the error would invite a retry that creates another room.
    • handleDM treats m.direct as a full snapshot. It rebuilds dmChannels and clears IsDirect on rooms that were removed.
    • Registering a direct room no longer overwrites a cached member profile, so DisplayName doesn't regress to empty.
  • Rooms

    • Membership events now create the Channel and maintain its Members, so unnamed joined rooms show up in Rooms().
    • Channel gets a separate Name field. Rooms() resolves the alias first, then the name, then the room ID. Clearing the canonical alias no longer discards the room name.
  • Logging

    • New builds two logrus loggers with the prefixed formatter, as matterclient does:
      • matrixclient with padding 13.
      • matrixclient: API with padding 18, at error level.
    • Sync errors go through the API logger.
    • The formatter dependency is added to go.mod and go.sum.

Co-authored-by: hloeung <95021+hloeung@users.noreply.github.com>
Co-authored-by: hloeung <95021+hloeung@users.noreply.github.com>
…ing-and-fix-issues

Co-authored-by: hloeung <95021+hloeung@users.noreply.github.com>
Copilot AI requested a review from hloeung October 11, 2026 20:17
@hloeung
hloeung marked this pull request as ready for review October 11, 2026 20:18
@hloeung
hloeung merged commit 1240a08 into master Oct 11, 2026
1 check passed
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