federatedbookkeeping / task-tracking

This repo contains the artefacts tracking work done on the Federated Task-Tracking project, funded by NLnet and the NGI Assure Programme.
MIT License
5 stars 2 forks source link

mapping already exists #43

Closed michielbdejong closed 4 months ago

michielbdejong commented 4 months ago

I think when pushing a create, and the webhook comes back for our own action, we get:

Sent status=o&syntax=tiki&trackerId=3&ins_27=summary%20in%204&ins_28=description%20in%204&ins_31=job&ins_37=https%3A%2F%2Ftimesheet.dev4.evoludata.com%2Fitem894 To https://timesheet.dev4.evoludata.com/api/trackers/3/items Received {
  itemId: 895,
  status: 'o',
  fields: {
    taskSummary: 'summary in 4',
    taskDescription: 'description in 4',
    taskPriority: '',
    taskFiles: '',
    taskJob: 'job',
    taskAssignedTo: '',
    taskAssignedBy: '',
    taskRelated: '',
    taskGroups: '',
    taskURI: 'https://timesheet.dev4.evoludata.com/item894'
  },
  itemTitle: 'summary in 4',
  processedFields: {
    taskSummary: 'summary in 4',
    taskDescription: 'description in 4',
    taskPriority: '',
    taskFiles: ' ',
    taskJob: 'job',
    taskAssignedTo: '',
    taskAssignedBy: '',
    taskRelated: '',
    taskGroups: '',
    taskURI: 'https://timesheet.dev4.evoludata.com/item894'
  },
  nextTicket: 'LbD-TazPs28SNV_HHwC_MKFgCTwmfC2urlCmeMG2xEY'
}
issue created, adding mapping 895 https://timesheet.dev4.evoludata.com/item894
{
  toLocal: { 'https://timesheet.dev4.evoludata.com/item894': 895 },
  toOriginal: { '895': 'https://timesheet.dev4.evoludata.com/item894' }
}
/Users/michiel/gh/federatedbookkeeping/bridgeBot/dist/lrimap.js:86
            throw new Error("mapping already exists!");
                  ^

Error: mapping already exists!
    at LriMap.addMapping (/Users/michiel/gh/federatedbookkeeping/bridgeBot/dist/lrimap.js:86:19)
    at Bridge.<anonymous> (/Users/michiel/gh/federatedbookkeeping/bridgeBot/dist/bridge.js:189:43)
    at step (/Users/michiel/gh/federatedbookkeeping/bridgeBot/dist/bridge.js:44:23)
    at Object.next (/Users/michiel/gh/federatedbookkeeping/bridgeBot/dist/bridge.js:25:53)
    at fulfilled (/Users/michiel/gh/federatedbookkeeping/bridgeBot/dist/bridge.js:16:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Instead it should check if the mapping is different, not if it's existing.