Page 1 of 1

String case issue causes sync to stop working

Posted: Mon May 28, 2018 8:53 pm
by weppos
This is a follow up to my reply here viewtopic.php?f=2&t=2452
After extensive investigation, I believe I found what happened.

Yesterday I created on iOS a new site. I did not realize I already had it, and I re-created it with only a small difference in the case sensitivity:

Location: Isola Del Giglio
vs the one I already had
Location: Isola del Giglio

All the other fields (site name and country) were equivalent. I then assigned the newly downloaded dive to this site on iOS.
After I was navigating the sites I noticed "Del" was mispelled, and I lower cased it. Again, I didn't realize at that time another exact location was already present.

I tried to sync, it completed successfully from iOS to Drobopx, but the changes were not loaded into Mac.
In iOS I went back to the site list and I noticed that the site was reporting 2 dives. But when I was clicking on it, it only shown one.

I went on Mac and I saw I already had the same site. Hence on iOS I renamed the "Location" of the site into "Foo".
I navigated to the main panel, then back to the site list again, and I found the "Foo" site, and the previous "Isola del Giglio" site (remember, they were previously somehow merged).
Then I changed also the second site to "Bar" in the attempt to trigger a resync.

At that point, on iOS the sites were different. And I could see each of them having 1 dive.
However, on the Mac the changes were not synced. It looks like the Mac did not recognize as the chance ever happened.

I tried to create a dive in both Mac and iOS. It didn't force the resync.

Finally, I created a new site. That seems it forced the resync of the whole site list, at that point also the Mac inherited the Foo/Bar changes (as well the new site).

At that point, the new dive was there as well.

--

Long story short, I think there are potential issues if you create a site that duplicates an existing one for some fields where the only difference is the string case.
I would expect the new/edit site panel to validate the input and warn if an existing site is already present (case insensitive). Or perhaps handle sites to be case sensitive everwhere.

Re: String case issue causes sync to stop working

Posted: Tue May 29, 2018 4:32 am
by nick
You are correct, there are probably places that aren't checking against case. Usually you can pick an existing site from a dropdown or via autocomplete, though.

I will look in to it when I get a chance.

Thanks for the report.