Skip to content

Commit

Permalink
Solved issue with deletets in testing
Browse files Browse the repository at this point in the history
Reseting the application on the device was confusing sync services
because we were using the device's UUID as the client identifier.

This was an error all the way around and the sync client on the device
now generates and stores its own personal UUID.  This will allow
device recovery (which would reset the device UUID) and resolves
the issue with data deletion in testing.
  • Loading branch information
mzarra committed Jan 17, 2010
1 parent 45e9104 commit d6b02fa
Show file tree
Hide file tree
Showing 13 changed files with 657 additions and 312 deletions.
6 changes: 6 additions & 0 deletions Daemon/ZSyncDaemon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
B64FE70410EE728F00B15A8F /* clientDescription.plist in Resources */ = {isa = PBXBuildFile; fileRef = B64FE70310EE728F00B15A8F /* clientDescription.plist */; };
B64FE7C910EEA24500B15A8F /* DataModel.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = B64FE7C810EEA24500B15A8F /* DataModel.xcdatamodel */; };
B64FE94010EF35DF00B15A8F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B64FE93F10EF35DF00B15A8F /* libz.dylib */; };
B67ED12E1103765600314759 /* ZSyncConnectionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B67ED12D1103765600314759 /* ZSyncConnectionDelegate.m */; };
B691FB4210ED855F00207210 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB3B10ED855F00207210 /* AppDelegate.m */; };
B691FB4310ED855F00207210 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B691FB3C10ED855F00207210 /* main.m */; };
B691FB4410ED855F00207210 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B691FB3E10ED855F00207210 /* InfoPlist.strings */; };
Expand All @@ -33,6 +34,8 @@
B64FE70310EE728F00B15A8F /* clientDescription.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = clientDescription.plist; sourceTree = "<group>"; };
B64FE7C810EEA24500B15A8F /* DataModel.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = DataModel.xcdatamodel; sourceTree = "<group>"; };
B64FE93F10EF35DF00B15A8F /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
B67ED12C1103765600314759 /* ZSyncConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZSyncConnectionDelegate.h; sourceTree = "<group>"; };
B67ED12D1103765600314759 /* ZSyncConnectionDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZSyncConnectionDelegate.m; sourceTree = "<group>"; };
B691FB3A10ED855F00207210 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
B691FB3B10ED855F00207210 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
B691FB3C10ED855F00207210 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Classes/main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -191,6 +194,8 @@
B691FB8910ED875800207210 /* ZSync.h */,
B691FB8A10ED875800207210 /* ZSyncHandler.h */,
B691FB8B10ED875800207210 /* ZSyncHandler.m */,
B67ED12C1103765600314759 /* ZSyncConnectionDelegate.h */,
B67ED12D1103765600314759 /* ZSyncConnectionDelegate.m */,
);
name = DesktopCode;
path = ../DesktopCode;
Expand Down Expand Up @@ -302,6 +307,7 @@
B691FB8F10ED875800207210 /* ZSyncHandler.m in Sources */,
B64FE7C910EEA24500B15A8F /* DataModel.xcdatamodel in Sources */,
B6EC175D10F5033E0051FD2E /* GTMNSData+zlib.m in Sources */,
B67ED12E1103765600314759 /* ZSyncConnectionDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion Daemon/clientDescription.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>DisplayName</key>
<string>SampleDesktop</string>
<string>SampleTouch</string>
<key>Entities</key>
<dict>
<key>com.zarrastudios.zsync.SampleData.TopLevelObject</key>
Expand Down
52 changes: 52 additions & 0 deletions DesktopCode/ZSyncConnectionDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// ZSyncConnectionDelegate.h
// ZSyncDaemon
//
// Created by Marcus S. Zarra on 1/17/10.
// Copyright 2010 Zarra Studios LLC. All rights reserved.
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//

#import <SyncServices/SyncServices.h>
#import "ZSyncShared.h"

@interface ZSyncConnectionDelegate : NSObject <BLIPConnectionDelegate, NSPersistentStoreCoordinatorSyncing>
{
id codeController;
BLIPConnection *_connection;
NSString *pairingCode;
NSString *clientIdentifier;

NSMutableArray *storeFileIdentifiers;

NSManagedObjectModel *managedObjectModel;
NSPersistentStoreCoordinator *persistentStoreCoordinator;
NSManagedObjectContext *managedObjectContext;
}

@property (retain) BLIPConnection *connection;
@property (retain) NSString *pairingCode;
@property (retain) NSString *clientIdentifier;

@property (retain) id codeController;

@end
Loading

0 comments on commit d6b02fa

Please sign in to comment.