Changes on my iPhone propagate to my Mac but don't affect my DB sync file's timestamp

ThomasK
ThomasK
Community Member
edited April 2016 in Mac

I use DropBox to sync my have personal "Primary" vault between 1PW running on both my iPhone and my Mac. I've noticed that if I make a vault change -- e.g. add an entry -- on my iPhone, the change propagates fine to my Mac, but the timestamp on the DropBox 1Password.agilekeychain file is unaffected. If I do it the other way, making the change on my Mac, it too propagates fine (to the iPhone), and in that case the keychain file does get "touched", as I'd expect.

Is that weird? Broken?

thx.

Up to date versions of everything.

Comments

  • littlebobbytables
    littlebobbytables
    1Password Alumni

    Hi @ThomasK,

    The sync container, whether it's an OPVault or Agile Keychain isn't actually a single file but a file bundle. OS X treats it like a file but it's really a folder that contains sub-folders and multiple files and when you edit something in your vault and 1Password syncs the changes to the Agile Keychain or OPVault it's altering one of the files inside the file bundle. I don't know the technical differences between how Dropbox works on a Mac and iOS but I wouldn't be concerned about this, it could be just a side-effect of how iOS syncs as it does have to do things quite differently.

    As long as syncing is working properly in both directions I'd say there is nothing to worry about :smile:

  • ThomasK
    ThomasK
    Community Member

    Thanks @littlebobbytables. I'm not exactly worried I'm just trying to understand 1PW a bit more in order to decide whether to roll out Teams in my company. This sync question is simply me trying to understand what's going on in general.

    In that context, your idea does seem to make sense however, on closer inspection, I don't think it explains what I'm seeing. I dropped into terminal on my Mac and diff'd the package directory tree before and after a change. If the change was made on my Mac, I can see that a couple of files get touched, both down in .../1Password.agilekeychain/data/default/. However, if the change is made on my iPhone, nothing changes even though the modification to the 1PW entry does propagate correctly. I did only check file and directory existence and timestamps though, and did not look at file contents. So I guess it's conceivable that something could have changed but which would not show up in a diff of the file and directory info.

    But I'm going to review you guys' white paper before start messing with md5-ing the tree, or bugging y'all with any more questions. I may not need to do either if I get what I need from the paper. I'll yell later if I need any more input.

    thanks,
    Thomas

  • littlebobbytables
    littlebobbytables
    1Password Alumni

    Greetings @ThomasK,

    So that's surprising. I would expect one of the files in the default folder to change and have its timestamps change as a result and that would purely be because Dropbox should be downloading an updated version of that file to the Mac. If the contents of one of the .1password files changed and the timestamp didn't that would also mess with my head. What I know from my own experiences is when I alter an item in 1Password for iOS I will see a Dropbox notification informing me that one of the bands in my OPVault container has changed. I've never looked at the timestamps as I've never thought about it.

    The other bizarre part is the filesystem is telling 1Password that the Agile Keychain has changed as that's how we react. We ask the operating system to tell us about any changes to the Agile Keychain folder and when we get notified we perform a sync. So the filesystem thinks something has changed. Sometimes we like to talk about trying to make 1Password seem magical but really you want everything explainable and deterministic when it comes down to it. I'm surprised the timestamps don't back up what I said in my previous message.

  • ThomasK
    ThomasK
    Community Member

    OK I clearly have no clue what's going on. With anything.

    Reading what you just wrote, I too kept an eye on my DB notifications and then tried an iPhone-invoked change. And lo and behold I did see a little burst of activity there. And I'm thinking, that's bizarre! How can DB show me changes there yet the file timesta... Hang on! Let's just check them again...

    Whu!? They have changed. But I swear they were not changing earlier! I ran several checks -- changing between the iPhone and the Mac. In each case the change propagated, but only when the change was Mac-invoked were the DB files touched. Sigh. Must be some kind of senior moment...

    Sometimes we like to talk about trying to make 1Password seem magical ...

    Well clearly all you have to do is simply market it to more decrepit, mentally-declining old gits like me and mission accomplished! :)

  • Hi @ThomasK,

    I'm glad you were able to see the changes happen eventually!

    If you're looking at these files in the Finder, it might explain why the timestamps aren't updating. The Finder is awful about updating values in windows you have open. From file size to time stamps, it has traditionally not been good at its job.

    Let us know if you need anything else

    Rudy

  • ThomasK
    ThomasK
    Community Member

    @rudy, I agree. In fact, I initially forgot, until @littlebobbytables reminded me, that in the Finder, the 1Password.agilkeychain is an OS X Package, with its contents hidden. It was then that I moved down to a Terminal and the command line. I don't know how much more accurate things are there these days, and it may not be as unix-ish as it pretends, but I figured I was at least nearer "reality" than the Finder in Aqua is.

    Once there I ran:

    ls -alRt 1Password.agilekeychain/ > ~/b4-iphone-change

    then I made a change on 1PW on my iPhone and waited until it was visible in 1PW on my Mac. I then ran:

    ls -alRt 1Password.agilekeychain/ > ~/after-iphone-change

    and finally

    diff ~/b4-iphone-change ~/after-iphone-change

    The latter produced nothing. I then did the whole thing again, but this time in the opposite direction, changing on the Mac and letting it propagate to the iPhone. This time the diff did show a change. (So, incidentally, did Finder, now that I was looking inside the 1Password.agilkeychain package.) I then repeated the whole lot -- both directions -- and saw the same results: propagation but no file change for iPhone-invoked change; propagation plus file change for Mac-invoked change. I was then going to try adding file-content checking, either just by cat'ing them, or via an md5 hash or something, but that's when I decided to ask my question.

    Then, later yesterday, based again on some info from @littlebobbytables (someone give that dude a pay rise or something, or at least a pat on the back from me), I repeated the whole lot, but now with my DB menu icon's pulldown menu open so I could watch the log of changes as they happened. Surprisingly, an iPhone-invoked change did trigger activity there. And, now incredibly, my Terminal diff also showed a change. (And, so did the internals of the package.)

    So either I was imagining things in the first place, or me looking at that DB pulldown really did affect something, in which case we have perhaps The Most Awesome Heisenbug I've ever seen[1]. Of course there's always the third option that there actually is weirdness, it's just even weirder than the initial weirdness suggested, such weird weirdness always having the capacity to weird us out. I'll settle for it being my imagination. Unless I see it again...

    Thomas

    [1] Actually, I have in my collection -- I'm in software test BTW -- an utter corker from years ago that would give this one a run for its money.

  • Hi Thomas,

    I'm glad to hear it's working now, but we're kind of stumped that you didn't see it before as well. Usually doing it in the Terminal is accurate. If you notice it again, try the md5 hash and see what you find.

    Cheers,
    Kevin

This discussion has been closed.