Why Can’t We Be Friends? Conflict Resolution in Azure Mobile Services

Why Can’t We Be Friends? Conflict Resolution in Azure Mobile Services

The story is always the same… we develop this brand new app, introduce it to Azure, and they get along like gangbusters… constantly sending data back and forth. Then they have a little squabble, the lights go out and the internet is down, but Azure & the app survive with some offline data sync’ing. But then it happens… a major conflict rears its ugly head testing the friendship between our app and Azure! Well, we’re not going to let a little road bump ruin a good thing! We’re going to show these two a little Conflict Resolution! What Kind of Conflicts Can Occur? It’s a rough world out there, lots of different ways to have a misunderstanding and get into a conflict, especially when our app can travel all over the place, go offline and then sync data back up later… so let’s walk through some of the scenarios that lead to conflicts so we can help our app and Azure before their spat turns into an all out fight! While offline, a user updates a record and saves it locally. Upon regaining network access, the app pushes the changed record to Azure, only to find out the record has already been changed by some one else! A user deletes a record, while offline of course (why does it seem that bad things always happen offline?). When the app tries to push the delete to Azure, again somebody has already updated it! What’s going to happen here?!? While online (whoa, something bad happened while connected?) the app submits a record which conflicts with a constraint setup in the backing...
Code Mill Minute: Setting Up Xamarin Studio To Work With TFS Online Git Source Control

Code Mill Minute: Setting Up Xamarin Studio To Work With TFS Online Git Source Control

Today I’m starting a new series of blog posts entitled “Code Mill Minute”. These will be a departure from my normal novel length posts (I’m trying to shorten those too, but that’s another story) and will focus on just fixing or doing something that we developers encounter on a day to day basis. Short and sweet… to the point… and only takes a minute to read. So let’s dive into today’s topic … integrating Xamarin Studio on the Mac with TFS Online’s (aka Visual Studio Online) Git source control. The Problem By default, the account you login as to Visual Studio Online is your Microsoft account, which is an email address. The problem with that is the “@” symbol. Applications other than Visual Studio have an issue using that symbol to connect with Git. The Solution We need to enable another set of credentials in TFS Online, link the new credentials up to our existing VSOnline account, clone the repository with our new user, then have Xamarin Studio perform a remote Git operation, so it can cache the user credentials as well. Enabling VSOnline Alternate Credentials The first thing we’ll do is enable alternate credentials in VSOnline. To do so, follow these steps. Login to VSOnline with your normal credentials In the upper right corner, you’ll see your name, click on that, then click on “My Profile” in the resulting dropdown. A screen similar to the one below will appear. Click on the “Credentials” tab and then “Enable Alternate Credentials”. Enter the username and password you want to use for Git access with Xamarin Studio (or the command line)....