Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MIGRATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ data model as well as any custom migrations.
- Add a new `UserSuggestion` entity
- Add a one-to-many relationship between `Blog` and `UserSuggestion`


# Decommissioned

The models below were removed from the app on Jan 8th 2026 to reduce the app size and improve compile time.

## WordPress 99

@chipsnyder 2020-10-05
Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [*] Fix previewing posts on WordPress.com atomic sites [#25045]
* [*] Stats: Rename "External Links" to "Clicks" to be consistent with the web [#25090]
* [*] Stats: Fix locations data discrepancy with the web [#25105]
* [*] Techical: Remove obsolete Core Data models to slightly reduce the app size (-6.4 MB) [#25124]


26.5
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
90 changes: 0 additions & 90 deletions Tests/KeystoneTests/Tests/CoreData/ContextManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,96 +53,6 @@ class ContextManagerTests: XCTestCase {
)
}

// The `_` at the start of the method makes it so that the XCTest runner will not pick it up as
// a test to run.
//
// It's not practical to run this test every time because it walks through 100+ migrations and
// takes 90 seconds (Intel MacBook Pro 2019)!
//
// We're keeping the code here just in case we'll ever need to test the full migration flow.
func _testIterativeMigration19ToLatest() throws {
var objectID: NSManagedObjectID? = nil

try prepareForMigration(withModelName: "WordPress 19") { context in
// Insert a Theme Entity
let objectOriginal = NSEntityDescription.insertNewObject(forEntityName: Theme.entityName(), into: context)
try context.obtainPermanentIDs(for: [objectOriginal])
try context.save()

XCTAssertFalse(objectOriginal.objectID.isTemporaryID, "Should be a permanent object")
objectID = objectOriginal.objectID

try XCTAssertThrowsError(
WPException.objcTry({
objectOriginal.value(forKey: "author")
}),
"Theme.author doesn't exist in WordPress 19 but we were able to fetch it"
)
}

// Migrate to the latest
let contextManager = ContextManager(modelName: ContextManagerModelNameCurrent, store: storeURL)
let object = try contextManager.mainContext.existingObject(with: XCTUnwrap(objectID))
XCTAssertNotNil(object, "Object should exist in new PSC")
XCTAssertNoThrow(object.value(forKey: "author"), "Theme.author should exist in current model version, but we were unable to fetch it")
}

func testMigrate24to25AvatarURLtoBasePost() throws {
let model24Name = "WordPress 24"
let model25Name = "WordPress 25"

let authorAvatarURL = "http://lorempixum.com/"

try prepareForMigration(withModelName: model24Name) { context in
let account = newAccountInContext(context: context)
let blog = newBlogInAccount(account: account)

let post = NSEntityDescription.insertNewObject(forEntityName: Post.entityName(), into: context) as! Post
post.blog = blog
post.authorAvatarURL = authorAvatarURL

let readerPost = NSEntityDescription.insertNewObject(forEntityName: ReaderPost.entityName(), into: context) as! ReaderPost
readerPost.authorAvatarURL = authorAvatarURL

try context.save()
}

// Initialize 24 > 25 Migration
let contextManager = ContextManager(modelName: model25Name, store: storeURL)
let secondContext = contextManager.mainContext

// Test the existence of Post object after migration
let allPostsRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Post")
let postsResults = try! secondContext.fetch(allPostsRequest)
XCTAssertEqual(1, postsResults.count, "We should get one Post")

// Test authorAvatarURL integrity after migration
let existingPost = postsResults.first! as! Post
XCTAssertEqual(existingPost.authorAvatarURL, authorAvatarURL)

// Test the existence of ReaderPost object after migration
let allReaderPostsRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "ReaderPost")
let readerPostsResults = try! secondContext.fetch(allReaderPostsRequest)
XCTAssertEqual(1, readerPostsResults.count, "We should get one ReaderPost")

// Test authorAvatarURL integrity after migration
let existingReaderPost = readerPostsResults.first! as! ReaderPost
XCTAssertEqual(existingReaderPost.authorAvatarURL, authorAvatarURL)

// Test for existence of authorAvatarURL in the model
let secondAccount = newAccountInContext(context: secondContext)
let secondBlog = newBlogInAccount(account: secondAccount)
let page = NSEntityDescription.insertNewObject(forEntityName: String(describing: Page.self), into: secondContext) as! Page
page.blog = secondBlog
page.authorAvatarURL = authorAvatarURL

do {
try secondContext.save()
} catch let error as NSError {
XCTAssertNil(error, "Setting authorAvatarURL shouldn't throw an error")
}
}

func testSaveDerivedContextWithChangesInMainContext() throws {
let contextManager = ContextManager.forTesting()
let derivedContext = contextManager.newDerivedContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)tearDown {
}

- (void)testModelUrl {
NSURL *url = [self urlForModelName:@"WordPress 20" inDirectory:nil];
NSURL *url = [self urlForModelName:@"WordPress 102" inDirectory:nil];

XCTAssertNotNil(url);
}
Expand Down