API Issue - not persistent items

Hi,

I noticed a strange and annoying behavior, I’ve got a script (based on the documentation) to populate easily my inbox through the day. It seems to be working, BUT, if I close Everdo and reopen it, the added inbox elements aren’t there anymore, unless I edited them beforehand.

My script output returns an error:

ReferenceError: items is not defined
  at Wi.createOrUpdate (file:///C:/Users/xXx/programs/everdo/resources/app.asar/bundle.js:540:1743418)
  at e.itemsPost (file:///C:/Users/xXx/programs/everdo/resources/app.asar/bundle.js:17:255811)
  at file:///C:/Users/xXx/programs/everdo/resources/app.asar/bundle.js:407:1795849
  at e.authenticate (file:///C:/Users/xXx/programs/everdo/resources/app.asar/bundle.js:407:1795225)
  at file:///C:/Users/xXx/programs/everdo/resources/app.asar/bundle.js:407:1795743
  at Layer.handle [as handle_request] (C:\Users\xXx\programs\everdo\resources\app.asar\node_modules\express\lib\router\layer.js:95:5)
  at next (C:\Users\xXx\programs\everdo\resources\app.asar\node_modules\express\lib\router\route.js:137:13)
  at Route.dispatch (C:\Users\xXx\programs\everdo\resources\app.asar\node_modules\express\lib\router\route.js:112:3)
  at Layer.handle [as handle_request] (C:\Users\xXx\programs\everdo\resources\app.asar\node_modules\express\lib\router\layer.js:95:5)
  at C:\Users\xXx\programs\everdo\resources\app.asar\node_modules\express\lib\router\index.js:281:22

This is happenning under win10 and win8.1.
Sync with my phone is working as expected.

Furthermore, I noticed an long section at the end of a JSON Export with dozens of:

   {"sync_id":"69B31D8FAB6E465CAAAA11D933123132","sync_id_string":"69B31D8FAB6E465CAAAA11D933123132","ts":1611766445,"entity_type":"i"}

I can usually cope with it, as I usually clean my inbox in the evening, but I lost some items due to unplanned reboots.

Thanks for the help :slight_smile:

Could you please post your code?

Hi, thanks for looking into this :slight_smile:

It strongly inspired by your documentation.

In bash

#!/bin/bash
if [ $# -eq 0 ] 
then
read todo
else
todo=$@
fi

data()
{
    cat <<EOF
{
    "title": "$todo"
}
EOF
}

curl -ks --header "Content-Type: application/json" \
    --request POST \
    --data "$(data)" \
 https://localhost:11111/api/items?key=xxxxxx > /dev/null

I tried a similar script in Python and powershell, same result. I tried the script from the documentation with as little modification (port/key) as possible, and the result was the same.

I was able to reproduce this. I will try to push a fix soon.