wayneashleyberry / wunderline

✅️ Command-line client for Wunderlist, the easiest way to get stuff done.
https://git.io/vM45l
MIT License
310 stars 29 forks source link

Not all subtasks are added to the task #110

Closed loreucci closed 7 years ago

loreucci commented 7 years ago

First of all, thank you for creating wunderline, I just installed it and it already improved my wunderlist experience!

However, I encountered some issues when I tried to add tasks with many subtask. Aside from the fact that the subtasks appeared in a completely different order from the one in the command, I noticed that sometimes not all subtasks were added. Then I tried to redo the same command and everytime the results were different (different order, different tasks missing). Moreover, the more the subtasks, the more was the chance that someone was missing.

For example, running this command: $ wunderline add 't' --subtask '1' --subtask '2' --subtask '3' --subtask '4' --subtask '5' --subtask '6' --subtask '7' --subtask '8' --subtask '9' --subtask '10'

led to these subtask lists: 9 6 7 5 10 10 5 7 8 4 3 6 9 2 3 6 9 5 2 7 9 10

By running the command with NODE_DEBUG=request it seems like all the requests are sent, so maybe this is a server-side issue:

REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/tasks',
  body: { title: 't', list_id: <listID>, starred: false },
  callback: [Function] }
REQUEST make request https://a.wunderlist.com/api/v1/tasks
REQUEST onRequestResponse https://a.wunderlist.com/api/v1/tasks 201 { 'cache-control': 'max-age=0, private, must-revalidate',
  'content-type': 'application/json',
  date: 'Tue, 13 Jun 2017 14:55:56 GMT',
  server: 'nginx',
  'x-current-user-id': '<currentID>',
  'x-request-id': '<reqID>',
  'content-length': '175',
  connection: 'Close' }
REQUEST reading response's body
REQUEST finish init function https://a.wunderlist.com/api/v1/tasks
REQUEST response end https://a.wunderlist.com/api/v1/tasks 201 { 'cache-control': 'max-age=0, private, must-revalidate',
  'content-type': 'application/json',
  date: 'Tue, 13 Jun 2017 14:55:56 GMT',
  server: 'nginx',
  'x-current-user-id': '<currentID>',
  'x-request-id': '<reqID>',
  'content-length': '175',
  connection: 'Close' }
REQUEST end event https://a.wunderlist.com/api/v1/tasks
REQUEST has body https://a.wunderlist.com/api/v1/tasks 175
REQUEST emitting complete https://a.wunderlist.com/api/v1/tasks
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '10', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '9', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '8', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '7', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '6', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '5', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '4', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '3', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '2', completed: false },
  callback: [Function] }
REQUEST { method: 'POST',
  json: true,
  baseUrl: 'https://a.wunderlist.com/api/v1',
  headers: 
   { 'X-Access-Token': ' <token>',
     'X-Client-ID': '<ID>' },
  url: '/subtasks',
  body: { task_id: <taskID>, title: '1', completed: false },
  callback: [Function] }
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST make request https://a.wunderlist.com/api/v1/subtasks
REQUEST onRequestResponse https://a.wunderlist.com/api/v1/subtasks 201 { 'cache-control': 'max-age=0, private, must-revalidate',
  'content-type': 'application/json',
  date: 'Tue, 13 Jun 2017 14:55:57 GMT',
  server: 'nginx',
  'x-current-user-id': '<currentID>',
  'x-request-id': '<reqID2>',
  'content-length': '163',
  connection: 'Close' }
REQUEST reading response's body
REQUEST finish init function https://a.wunderlist.com/api/v1/subtasks
REQUEST response end https://a.wunderlist.com/api/v1/subtasks 201 { 'cache-control': 'max-age=0, private, must-revalidate',
  'content-type': 'application/json',
  date: 'Tue, 13 Jun 2017 14:55:57 GMT',
  server: 'nginx',
  'x-current-user-id': '<currentID>',
  'x-request-id': '<reqID2>',
  'content-length': '163',
  connection: 'Close' }
REQUEST end event https://a.wunderlist.com/api/v1/subtasks
REQUEST has body https://a.wunderlist.com/api/v1/subtasks 163
REQUEST emitting complete https://a.wunderlist.com/api/v1/subtasks

Can you reproduce this? I'm running wunderline 4.6.0 on node v7.7.3 on Arch Linux, if this helps.

Thor77 commented 7 years ago

Can reproduce, thanks for your report! Will start working on a fix.

wayneashleyberry commented 7 years ago

Hey @loreucci - you're welcome and thank you :)

@Thor77 has worked on a fix and I've just published v4.6.1. Would you mind giving it a go?

loreucci commented 7 years ago

Just tried it and now everything is working as expected.

Thank you and keep up the good work!