fix: add explicit JSON property mappings for SQRLShipItRequest model (#49980)

* fix: add explicit JSON property mappings for SQRLShipItRequest model

* style: add patch body to mantle v2 fix patch
This commit is contained in:
Noah Gregory
2026-03-02 23:48:41 -05:00
committed by GitHub
parent 9f9a5b8b9b
commit 0ae46d71d3
2 changed files with 31 additions and 0 deletions

View File

@@ -10,3 +10,4 @@ chore_turn_off_launchapplicationaturl_deprecation_errors_in_squirrel.patch
fix_crash_when_process_to_extract_zip_cannot_be_launched.patch
use_uttype_class_instead_of_deprecated_uttypeconformsto.patch
fix_clean_up_old_staged_updates_before_downloading_new_update.patch
fix_add_explicit_json_property_mappings_for_shipit_request_model.patch

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah Gregory <noahmgregory@gmail.com>
Date: Fri, 27 Feb 2026 21:29:48 -0500
Subject: fix: add explicit JSON property mappings for ShipIt request model
When we rolled Mantle forward with #38437, we also implicitly upgraded
from v1 to v2 (our prior pinned commit was from the `maintenance-v1.x`
branch, while the new pinned commit is from the `master` branch). This
brought in a breaking change from v2 where JSON properties must now be
explicitly mapped. This adds such a mapping for `SQRLShipItRequest`.
diff --git a/Squirrel/SQRLShipItRequest.m b/Squirrel/SQRLShipItRequest.m
index 726f91d01524e3812cb3a769db2416f6638dbca6..5f0d6de57a6ee6b0bd8a24c439f87239295bd937 100644
--- a/Squirrel/SQRLShipItRequest.m
+++ b/Squirrel/SQRLShipItRequest.m
@@ -60,7 +60,13 @@ - (instancetype)initWithUpdateBundleURL:(NSURL *)updateBundleURL targetBundleURL
#pragma mark Serialization
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
- return @{};
+ return @{
+ @keypath(SQRLShipItRequest.new, updateBundleURL): @keypath(SQRLShipItRequest.new, updateBundleURL),
+ @keypath(SQRLShipItRequest.new, targetBundleURL): @keypath(SQRLShipItRequest.new, targetBundleURL),
+ @keypath(SQRLShipItRequest.new, bundleIdentifier): @keypath(SQRLShipItRequest.new, bundleIdentifier),
+ @keypath(SQRLShipItRequest.new, launchAfterInstallation): @keypath(SQRLShipItRequest.new, launchAfterInstallation),
+ @keypath(SQRLShipItRequest.new, useUpdateBundleName): @keypath(SQRLShipItRequest.new, useUpdateBundleName),
+ };
}
+ (NSValueTransformer *)updateBundleURLJSONTransformer {