Skip to content

Fix code review bugs and translation errors#5

Merged
zackslash merged 1 commit into
mainfrom
performance-improvements
Jun 20, 2026
Merged

Fix code review bugs and translation errors#5
zackslash merged 1 commit into
mainfrom
performance-improvements

Conversation

@zackslash

Copy link
Copy Markdown
Owner

Fixes bugs found in code review and corrects translation errors across 39 languages.

Bugs

  • m_startupSyncDone set before async download finished, notifying all existing messages on every daemon start
  • deleteMessages hit update_highest_message.json for user deletes, resetting server high-water mark backward and re-delivering old messages
  • m_pendingDeleteIds race on batch deletes
  • notification tracking maps never cleaned on dismiss (memory leak)
  • WebSocketManager did not zero secret/deviceId on disconnect

Refactors

  • MessageStore: QSet index for O(1) containsMessage (was O(n^2) per sync)
  • SailPushClient: sendRequest/emitError/extractErrorMessage helpers, Action enum
  • WebSocketManager: handleFrame extracted, parseFrame returns int
  • DbusInterface: runSystemctl helper
  • Daemon: isUiRunning, pollingIntervalFromIndex helpers, inline handleEmergencyMessage
  • NotificationManager: single-pass stripHtml
  • Shared constants.h for pending_open path

Cleanup

  • Remove dead userKey/deviceName from credential interface
  • Remove dead code: m_userAgent, unreadMessages, highestMessageId, maxMessages
  • Cache locale.name(), dedup sound download queue

Translations

  • Add missing LoginHelper string to all 39 .ts files
  • Fix errors in hr, bs, lv, be, is, hy, ka

Tests

7/7 passing. Net -97 lines.

Bug fixes:
- fix m_startupSyncDone set before async download completed, causing
  notifications for all existing messages on every daemon start
- fix deleteMessages API misuse: user-initiated deletes no longer hit
  update_highest_message.json, which reset the server high-water mark
  backward and caused re-delivery of old messages
- fix m_pendingDeleteIds race in batch deletes (member removed entirely)
- fix notification tracking maps never cleaned on dismiss/expiry by
  connecting to NotificationClosed D-Bus signal (memory leak)
- zero WebSocketManager secret/deviceId on disconnect

Refactors:
- MessageStore: add QSet index for O(1) containsMessage (was O(n) per
  call, O(n^2) per sync); simplify markAllAsRead; remove dead code
- SailPushClient: extract sendRequest/emitError/extractErrorMessage
  helpers, Action enum replaces string-based dispatch
- WebSocketManager: extract handleFrame from duplicated text/binary
  handlers; parseFrame returns int instead of QVariant
- DbusInterface: extract runSystemctl helper
- Daemon: extract isUiRunning and pollingIntervalFromIndex helpers,
  inline handleEmergencyMessage, skip redundant emergency notification
- NotificationManager: rewrite stripHtml to single-pass globalMatch
- share pending_open path via new constants.h (inline constexpr)

Cleanup:
- remove dead userKey/deviceName from credential interface (saved but
  never read back); remove dead m_userAgent member, unreadMessages,
  highestMessageId, maxMessages
- cache locale.name() in loadTranslations; dedup sound download queue

Translations:
- add missing LoginHelper string to all 39 .ts files (was absent after
  code added post-lupdate)
- fix errors: hr (prije typo), bs (nominative case x2), lv (leading
  space), be (adjective gender), is (afrita->dulrada, word order),
  hy (question mark), ka (deleting vs delete disambiguation)

Tests: 7/7 passing. Net -97 lines.
@zackslash
zackslash merged commit 88aa8fb into main Jun 20, 2026
1 check passed
@zackslash
zackslash deleted the performance-improvements branch July 15, 2026 21:02
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