+
Skip to content

Version 0.6.0: CoreData Migrations fix including xcdatamodels and xcmappingmodels #894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

mahee96
Copy link
Member

@mahee96 mahee96 commented Feb 25, 2025

Problem statement

  • When trying to migrate from 0.5.9 or 0.5.10 to 0.6.0 nightly or alpha, users were ending up with 2 sidestore official sources since the sourceURL was changed from "apps.sidestore.io" to "sidestore.io/apps-v2.json" and sidestore couldn't decide which one to use since it now has 2 official source causing the sources-fetch (swipe-down action on "News" tab to fail with fetch) errors.

Changes

  • Since we rebased from altstore-1.6.3 to altstore-2.0.x directly we can ignore the intermediate model versions and migrations xcmapping. So the following models have been deleted to reduce maintenance burden
    • AltStore 12.xcdatamodel
    • AltStore 13.xcdatamodel
    • AltStore 14.xcdatamodel
    • AltStore 15.xcdatamodel
    • AltStore 16.xcdatamodel
  • We are now doing a direct migration from AltStore 11.xcdatamodel to AltStore 17.xcdatamodel via custom migration mapping called "AltStore11toAltStore17.xcmappingmodel".
    • Within this we define the following custom migration policies (via custom migration policy classes):
      • StoreApp11To17MigrationPolicy.swift
      • Source11To17MigrationPolicy.swift
    • In StoreApp11To17MigrationPolicy we now move the [AppVersion] list from storeApp._versions into storeApp._releaseTrack._releases and set the storeApp._releaseTrack._track as stable while creating(establishing) relationships for StoreAppToStoreApp entity mapping.
      • This change facilitates the migration to newer ReleaseTracks feature
    • In Source11To17MigrationPolicy we now change the value of sourceURL if it is apps.sidestore.io to sidestore.io/apps-v2.json so that only 1 source ends up into the migrated database for the official sidestore source.
      • With this change, there won't be 2 official source after migation and no more confusion when saving to database upon first start of the sidestore after migration.

Key Highlights

  • After merging this PR we should be good to go for next release

Tests Performed:

  • install 0.5.9 built via xcode from source on simulator iOS 18.2 (iPhone 16 Pro).
  • install 0.6.0 from coredata-migration-fix branch on top of existing 0.5.9 which will be treated as an update.
  • Expectations:
    • No double sources for the sidestore official source in sources tab
    • No errors when refreshing/fetching (swipe down) on the News tab or MyApps tab.
    • in-app update delivery(install) retains the above 2 Expectation promises.
  • All tested to be working as expected.

Demo:

ScreenRecording2025-02-26.mp4

@mahee96 mahee96 changed the title Version 0.6.0: CoreData Migrations fix (Both Migration Policies and MergePolicy) including xcdatamodels and xcmappingmodels Version 0.6.0: CoreData Migrations fix including xcdatamodels and xcmappingmodels Feb 25, 2025
…olicy for Source and StoreApp to support sourceID renaming and ReleaseTracks integration respectively, removed intermediate models and xcmappingmodels since we jumped directly from altstore 1.6.3 to 2.0.x
@mahee96 mahee96 force-pushed the coredata-migration-fix branch from 2dfa438 to f4d367b Compare February 26, 2025 07:13
@mahee96 mahee96 marked this pull request as ready for review February 26, 2025 07:22
Copy link

Download the artifacts for this pull request (nightly.link):

Copy link

Builds for this Pull Request are available at
SideStore-0.6.0-pr.894+f4d367b.ipa
SideStore-0.6.0-pr.894+f4d367b-dSYM
Have a nice day.

@mahee96 mahee96 merged commit 136f07e into develop Feb 26, 2025
1 check passed
@mahee96 mahee96 deleted the coredata-migration-fix branch February 26, 2025 07:27
@bayard
Copy link

bayard commented Mar 14, 2025

If you still encounter coredata migration error, I may found the cause: the sources mess up. Run 0.5.10, just delete all sources except "SideStore Official", then upgrade to 0.6.0 (Mine is 0.6.0-pr.894), run again and you won't get the coredata migration error.

@mahee96
Copy link
Member Author

mahee96 commented Mar 14, 2025

I mean that will obviously fix the issue, but the bug is that users need not do this manually

@mahee96
Copy link
Member Author

mahee96 commented Mar 14, 2025

We will fix it soon in upcoming release

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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载