Skip to content

Comments

feat(nomad-device): introduce unified persistence event hook foundations for remote backup changelog (part 7) [WPB-23691]#3904

Open
MohamadJaara wants to merge 19 commits intodevelopfrom
mo/nomad-devices/feat/insert-message-hook-remote-backup
Open

feat(nomad-device): introduce unified persistence event hook foundations for remote backup changelog (part 7) [WPB-23691]#3904
MohamadJaara wants to merge 19 commits intodevelopfrom
mo/nomad-devices/feat/insert-message-hook-remote-backup

Conversation

@MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Feb 24, 2026

https://wearezeta.atlassian.net/browse/WPB-23691


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • The current hook contract is centered on message upsert and does not provide an interface for other persistence events.
  • Hook registration/wiring naming is still based on PersistMessageHookNotifier, which makes extension to additional event types harder.

Causes (Optional)

  • The hook architecture started with insert-message use cases and evolved incrementally as Nomad remote backup event needs expanded.

Solutions

  • Introduced PersistenceEventHookNotifier and event payload models (MessageDeleteEventData, ReactionEventData, ReadReceiptEventData, ConversationDeleteEventData, ConversationClearEventData).
  • Replaced/renamed hook registry and core wiring from message-only naming to persistence-event naming.
  • Added NoOpPersistenceEventHookNotifier.
  • Introduced Nomad persistence-event notifier implementation (NomadPersistenceEventHookNotifier) and updated related wiring.
  • Extended Nomad remote backup changelog repository/data source APIs to support additional event types at the domain layer.
  • Updated Nomad notifier tests and related message persistence tests to reflect the new notifier contract.

Dependencies (Optional)

None.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Notes (Optional)

  • This branch intentionally focuses on introducing the unified hook contract and foundational wiring.
  • Event emission from handlers/use-cases is split into the follow-up branch for easier review.

Attachments (Optional)

N/A


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

…nto nomad-devices/feat/implement-message-delete-readreciept-and-conversation-events
…te-readreciept-and-conversation-events

# Conflicts:
#	domain/messaging/hooks/src/commonMain/kotlin/com/wire/kalium/messaging/hooks/PersistMessageHook.kt
#	domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogCallback.kt
#	domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogHookNotifier.kt
#	domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogRepository.kt
#	domain/nomaddevice/src/commonTest/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogHookNotifierTest.kt
#	logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageHookRegistry.kt
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

Test Results

0 tests   - 4 443   0 ✅  - 4 326   0s ⏱️ - 5m 47s
0 suites  -   738   0 💤  -   117 
0 files    -   738   0 ❌ ±    0 

Results for commit db719d4. ± Comparison against base commit a2393e3.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 47.26027% with 77 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.94%. Comparing base (a2393e3) to head (db719d4).

Files with missing lines Patch % Lines
.../nomaddevice/NomadRemoteBackupChangeLogCallback.kt 63.01% 19 Missing and 8 partials ⚠️
...ic/feature/message/PersistenceEventHookRegistry.kt 0.00% 19 Missing ⚠️
...m/nomaddevice/NomadPersistenceEventHookNotifier.kt 0.00% 14 Missing ⚠️
.../wire/kalium/messaging/hooks/PersistMessageHook.kt 71.42% 6 Missing ⚠️
...in/kotlin/com/wire/kalium/logic/CoreLogicCommon.kt 0.00% 5 Missing ⚠️
...addevice/NomadRemoteBackupChangeLogHookNotifier.kt 63.63% 4 Missing ⚠️
.../wire/kalium/logic/feature/message/MessageScope.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3904      +/-   ##
===========================================
- Coverage    58.94%   58.94%   -0.01%     
===========================================
  Files         1927     1927              
  Lines        61142    61238      +96     
  Branches      6626     6637      +11     
===========================================
+ Hits         36043    36097      +54     
- Misses       22093    22131      +38     
- Partials      3006     3010       +4     
Files with missing lines Coverage Δ
...kalium/logic/data/message/PersistMessageUseCase.kt 19.73% <100.00%> (ø)
.../wire/kalium/logic/feature/message/MessageScope.kt 0.00% <0.00%> (ø)
...addevice/NomadRemoteBackupChangeLogHookNotifier.kt 53.33% <63.63%> (+20.00%) ⬆️
...in/kotlin/com/wire/kalium/logic/CoreLogicCommon.kt 0.00% <0.00%> (ø)
.../wire/kalium/messaging/hooks/PersistMessageHook.kt 77.77% <71.42%> (-7.94%) ⬇️
...m/nomaddevice/NomadPersistenceEventHookNotifier.kt 0.00% <0.00%> (ø)
...ic/feature/message/PersistenceEventHookRegistry.kt 0.00% <0.00%> (ø)
.../nomaddevice/NomadRemoteBackupChangeLogCallback.kt 67.02% <63.01%> (-6.15%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2393e3...db719d4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants