Skip to content

Conversation

jullianm
Copy link
Contributor

@jullianm jullianm commented Aug 29, 2025

TaskWPB-19688 [iOS] Move DB data model to `WireData`

Issue

This PR moves the zmessaging and ZMEventModel database models from WireDataModel framework to WireData package ensuring that the managed objects that were previously pointing to the Current Product Module now points to WireDataModel (where still reside their related subclasses).

Note: there was no need to re-generate the resources (i.e store2-129-0.wiredatabase) for the tests in WireDataModel as the tests were passing.

Sam's extra comments

I've assigned this PR to myself as @jullianm is out this week. Some things I've learnt which I didn't know before regarding the classes module:

Screenshot 2025-08-25 at 10 24 12

This can have 3 states:

  • Global Namespace
  • Current Product Module
  • Custom (we enter a target)

Global Namespace is required for managed object subclasses that are obj-c or those that are used from obj-c. This is because obj-c uses a global namespace (hence the need to add prefixes).

Current Product Module is like Custom but automatically sets the target based on where the database models reside. Currently Current Product Module resolves to WireDataModel but with this PR we move the database models to WireData while keeping the classes in WireDataModel. This means that we have to updates settings of Current Product Module to WireDataModel.

Looking at this PR I was surprised that it updates each version of zmessaging.xcdatamodeld, not just 2.129 but 2.128, 2.127, etc. I now realize that this is because some of our migration tests depend on our managed object subclasses with older database versions. For example, DatabaseMigrationTests_Conversations.testThatItPerformsMigrationFrom106_deleteConversationCascadesToParticipantRole(). I think this is a little problematic as there is no reason why the current version of ParticipantRole is compatible with version 2.106.0 for example. It would be better to use just NSManagedObject with KVC. However it's probably best to leave things how they are.

Beyond @jullianm's work I added one small additional test to assert that each managed object subclass of the latest data model can be instantiated.

Testing

  • Ensure app is building and running properly
  • Ensure tests in WireDataModel and WireSyncEngine are still passing
  • Ensure database migration from 2.128.0 to 2.129 is working properly

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@jullianm jullianm requested review from a team, KaterinaWire and samwyndham and removed request for a team August 29, 2025 14:29
Copy link
Contributor

github-actions bot commented Aug 29, 2025

Test Results

    9 files  226 suites   5m 52s ⏱️
1 044 tests 787 ✅ 0 💤 257 ❌
1 045 runs  789 ✅ 0 💤 256 ❌

For more details on these failures, see this check.

Results for commit 77fac82.

♻️ This comment has been updated with latest results.

@samwyndham samwyndham assigned samwyndham and unassigned samwyndham and jullianm Sep 1, 2025
@samwyndham samwyndham requested review from netbe and removed request for samwyndham September 2, 2025 08:19
Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for extensive description! One more thing to test before merging would be upgrade from a playground build to double check there's no pb

@samwyndham samwyndham added this pull request to the merge queue Sep 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2025
@samwyndham samwyndham added this pull request to the merge queue Sep 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2025
@datadog-wireapp
Copy link

⚠️ Tests

⚠️ Warnings

🧪 5 Tests failed

test_CalculateSupportedProtocols_AllActiveMLSClients_RemoteMLS() from WireDomainTests.CalculateSupportedProtocolsUseCaseTests (Datadog)
Crash: xctest (11518) CalculateSupportedProtocolsUseCaseTests.setUp()
test_CalculateSupportedProtocols_AllActiveMLSClients_RemoteProteus() from WireDomainTests.CalculateSupportedProtocolsUseCaseTests (Datadog)
Crash: xctest (11516) CalculateSupportedProtocolsUseCaseTests.setUp()
test_CalculateSupportedProtocols_AllActiveMLSClients_RemoteProteusAndMLS() from WireDomainTests.CalculateSupportedProtocolsUseCaseTests (Datadog)
Crash: xctest (11512) CalculateSupportedProtocolsUseCaseTests.setUp()
View all

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 77fac82 | Docs | Was this helpful? Give us feedback!

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.

4 participants