<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-forward-container">sorry, did not sent it to the
      list.<br>
      <br>
      --jan<br>
      <br>
      -------- Forwarded Message --------
      <table class="moz-email-headers-table" cellpadding="0"
        cellspacing="0" border="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject:
            </th>
            <td>Re: Mobile build -786 small test</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
            <td>Mon, 8 Feb 2016 17:48:02 +0100</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
            <td>Jan Mulder <a class="moz-txt-link-rfc2396E" href="mailto:jlmulder@xs4all.nl"><jlmulder@xs4all.nl></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
            <td>Dirk Hohndel <a class="moz-txt-link-rfc2396E" href="mailto:dirk@hohndel.org"><dirk@hohndel.org></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>On 08-02-16 17:26, Dirk Hohndel wrote:
> On Mon, Feb 08, 2016 at 01:28:05PM +0100, Jan Mulder wrote:
>>>> Also worth some profiling, I guess. IIRC the way the git save works is
>>>> that it creates the whole git tree in memory and then saves what is not on
>>>> disk. So that may cause the long duration with 750 long dives. But I would
>>>> need to spend more time to remind myself of how exactly this is done...
>> Did a little check with gprof, and that shows no real part in the code that
>> is responsible for this.
>>
>> Currently, I do not really understand all the rationale behind the save- and
>> cloud-management. I was under the impression that a "save" of a individual
>> dive only deals with the local cloudstorage tree, but it appears to do a lot
>> more.
> The local cache is a git repository. So if you "save" an edit, we create a
> new commit in that repository. That commit gets synced to the cloud either
> if you explicitly "upload to cloud" from the menu or the next time you
> open the app (I know, that's kinda counter intuitive).

Ok, that part I understood. But when not connected it does not create 
the local commit.

>> Tried to mess with my log with the phone in airplane mode. I expected
>> this to work, as there is a local cloudstorage tree, but this results in
>> errors in the console "Don't save dives without loading from the cloud
>> first" (and the response when hitting the save button is nicely very fast).
>> For obvious reasons, I do not think this all works as intended.
> Yeah, that sounds wrong. Can you be a little more precise what you tried
> and what messages you got so I can reproduce this? The "don't save without
> loading" thing should not happen...

What I do is simple. Make sure that app is stopped. Put phone in 
airplane mode (the easy way to prevent internet access). The application 
log shows (correctly) "Cloud storage connection not working correctly", 
but just before that also "766 dives loaded from cache". Now edit a 
dive, save it. Nothing is shown to the user, but the application log 
shows "Don't save dives without loading from the cloud first" on the 
save action, and the data is not saved. It just seems to save correctly, 
but it is not.

> And the saving is nice and fast most likely because it didn't save :-)

Exactly, that whats I read from the code. But I expected a commit to the 
local cache that can be merged later when the connection to internet is 
restored again.

best,

--jan
</pre>
      <br>
    </div>
    <br>
  </body>
</html>