How could the description change without an action being recorded?

Hi there, I have a function that triggers when the description on a card is updated, and it parses some email content and updates the description.

Later, another description change is recorded, however the “old” desc showing in the action is not the one it was updated to previously – that is to say that somehow the description has changed but no action shows that change. Here is a screenshot showing the actions to update the card description:

Can you share a bit more context on the setup of what you’re doing?

Is this backed by a Trello webhook? Or are you doing some sort of GET polling? Or something else?

In the screenshot, is that the response of a GET to an /actions endpoint?

Hey Bentley, thanks for getting back to me. Yep this is a webhook:

The screenshot I’m showing is from the JSON output of the card:

So regardless of how my system is handling the webhooks, the actions recorded on the card are showing that the description changed, but then the next time it changed the “old” desc wasn’t the thing that it was changed to previously. The description had changed back without a corresponding action being shown in the history of the card.

Hey Bentley,

I have another example of this happening. On this card:

https://trello.com/c/aNEH6Exn/6027-order-leedstone-inc

If you load the actions to update the description:

https://trello.com/1/cards/aNEH6Exn/actions?filter=updateCard:desc

Then you can see that there is an update to set the “Carrier” to “UPS”, and in the action that occurs immediately after that, the “old” desc doesn’t have that information. I’ve extracted just those 2 adjacent actions and REDACTED any sensitive information here, just search for “Carrier: UPS”:

  {
    "id": "5ff877d5a1f66a2946d6eccd",
    "idMemberCreator": "5ae7b3a1b64b0e2c3e604cc7",
    "data": {
      "old": {
        "desc": "____\nData Fields\n____\nOrder ID: aNEH6Exn\nCompany Name: Leedstone Inc\nCompany Contact Name: REDACTED\nCompany Contact Email: REDACTED\nCompany Contact Phone: REDACTED\nContact Name: REDACTED\nContact Email: REDACTED\nPrice Type: USD\nWarehouse number: 345110\nOrder/Invoice number:\nClient's PO Number: C21007C\nItems: \n8 x Green Spray - 12 bottles/case (G12)\nShipping address:\nREDACTED\nWeight: 57 Lbs\nDimensions: 48 x 40 x 15\n% discount on shipping:\nCost shipping: $ 53.19\nQuote number:\nCarrier:\nTracking info: \n____\n\nIf applicable:\nProfessional Discount:\nNote:\n\n\nTESTING New shipping details:\nNumber of pallets used: 1\nTotal weight of this shipment: 25 kg\nDimensions and weight in each pallet:\n121 X 101 X 17 cm / 25.6 kg{\"obj\":[{\"pallet_data\":{\"w\":101,\"h\":17,\"d\":121,\"id\":\"Pallet1\",\"used_space\":33.1233,\"weight\":25.6,\"used_weight\":1.9062,\"order_id\":null},\"items\":[{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2}]}]}"
      },
      "card": {
        "desc": "____\nData Fields\n____\nOrder ID: aNEH6Exn\nCompany Name: REDACTED\nCompany Contact Name: REDACTED\nCompany Contact Email: REDACTED\nCompany Contact Phone: REDACTED\nContact Name: REDACTED\nContact Email: REDACTED\nPrice Type: USD\nWarehouse number: 345110\nOrder/Invoice number: 1005877\nClient's PO Number: C21007C\nItems: \n8 x Green Spray - 12 bottles/case (G12)\nShipping address:\nREDACTED\nWeight: 57 Lbs\nDimensions: 48 x 40 x 15\n% discount on shipping:\nCost shipping: $ 53.19\nQuote number:\nCarrier:\nTracking info: \n____\n\nIf applicable:\nProfessional Discount:\nNote:\n\n\nTESTING New shipping details:\nNumber of pallets used: 1\nTotal weight of this shipment: 25 kg\nDimensions and weight in each pallet:\n121 X 101 X 17 cm / 25.6 kg{\"obj\":[{\"pallet_data\":{\"w\":101,\"h\":17,\"d\":121,\"id\":\"Pallet1\",\"used_space\":33.1233,\"weight\":25.6,\"used_weight\":1.9062,\"order_id\":null},\"items\":[{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2}]}]}",
        "id": "5ff78a1da264961c16337c4f",
        "name": "ORDER: REDACTED",
        "idShort": 6027,
        "shortLink": "aNEH6Exn"
      },
      "board": {
        "id": "59e7d6836ad580069fa7f3f2",
        "name": "Order Processing",
        "shortLink": "aevORRoW"
      },
      "list": {
        "id": "5ba35264534c1c48786e5cff",
        "name": "QuickBooks"
      }
    },
    "type": "updateCard",
    "date": "2021-01-08T15:18:45.765Z",
    "limits": {
      
    },
    "appCreator": {
      "id": "5ae7b4504e68cdf39fbcb090"
    },
    "memberCreator": {
      "id": "5ae7b3a1b64b0e2c3e604cc7",
      "username": "REDACTED",
      "activityBlocked": false,
      "avatarHash": null,
      "avatarUrl": null,
      "fullName": "REDACTED",
      "idMemberReferrer": null,
      "initials": "TC",
      "nonPublic": {
        "fullName": "REDACTED",
        "initials": "TC",
        "avatarHash": null
      },
      "nonPublicAvailable": true
    }
  },
  {
    "id": "5ff8776f036181043183155d",
    "idMemberCreator": "5ae7b3a1b64b0e2c3e604cc7",
    "data": {
      "old": {
        "desc": "____\nData Fields\n____\nOrder ID: aNEH6Exn\nCompany Name: REDACTED\nCompany Contact Name: REDACTED\nCompany Contact Email: REDACTED\nCompany Contact Phone: REDACTED\nContact Name: REDACTED\nContact Email: REDACTED\nPrice Type: USD\nWarehouse number: 345110\nOrder/Invoice number:\nClient's PO Number: C21007C\nItems: \n8 x Green Spray - 12 bottles/case (G12)\nShipping address:\nREDACTED\nWeight: 57 Lbs\nDimensions: 48 x 40 x 15\n% discount on shipping:\nCost shipping: $ 53.19\nQuote number:\nCarrier:\nTracking info: \n____\n\nIf applicable:\nProfessional Discount:\nNote:\n\n\nTESTING New shipping details:\nNumber of pallets used: 1\nTotal weight of this shipment: 25 kg\nDimensions and weight in each pallet:\n121 X 101 X 17 cm / 25.6 kg{\"obj\":[{\"pallet_data\":{\"w\":101,\"h\":17,\"d\":121,\"id\":\"Pallet1\",\"used_space\":33.1233,\"weight\":25.6,\"used_weight\":1.9062,\"order_id\":null},\"items\":[{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2}]}]}"
      },
      "card": {
        "desc": "____\nData Fields\n____\nOrder ID: aNEH6Exn\nCompany Name: REDACTED\nCompany Contact Name: REDACTED\nCompany Contact Email: REDACTED\nCompany Contact Phone: REDACTED\nContact Name: REDACTED\nContact Email: REDACTED\nPrice Type: USD\nWarehouse number: 345110\nOrder/Invoice number:\nClient's PO Number: C21007C\nItems: \n8 x Green Spray - 12 bottles/case (G12)\nShipping address:\nREDACTED\nWeight: 57 Lbs\nDimensions: 48 x 40 x 15\n% discount on shipping:\nCost shipping: $ 53.19\nQuote number:\nCarrier: UPS\nTracking info: \n____\n\nIf applicable:\nProfessional Discount:\nNote:\n\n\nTESTING New shipping details:\nNumber of pallets used: 1\nTotal weight of this shipment: 25 kg\nDimensions and weight in each pallet:\n121 X 101 X 17 cm / 25.6 kg{\"obj\":[{\"pallet_data\":{\"w\":101,\"h\":17,\"d\":121,\"id\":\"Pallet1\",\"used_space\":33.1233,\"weight\":25.6,\"used_weight\":1.9062,\"order_id\":null},\"items\":[{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2},{\"id\":\"green spray - 12 bottles/case\",\"w\":17,\"h\":22,\"d\":23,\"wg\":3.2}]}]}",
        "id": "5ff78a1da264961c16337c4f",
        "name": "ORDER: REDACTED",
        "idShort": 6027,
        "shortLink": "aNEH6Exn"
      },
      "board": {
        "id": "59e7d6836ad580069fa7f3f2",
        "name": "Order Processing",
        "shortLink": "aevORRoW"
      },
      "list": {
        "id": "5ba352b845ebbe2a03c54e9a",
        "name": "Send Shipping Instructions"
      }
    },
    "type": "updateCard",
    "date": "2021-01-08T15:17:03.259Z",
    "limits": {
      
    },
    "appCreator": {
      "id": "5ae7b4504e68cdf39fbcb090"
    },
    "memberCreator": {
      "id": "5ae7b3a1b64b0e2c3e604cc7",
      "username": "REDACTED",
      "activityBlocked": false,
      "avatarHash": null,
      "avatarUrl": null,
      "fullName": "REDACTED",
      "idMemberReferrer": null,
      "initials": "TC",
      "nonPublic": {
        "fullName": "REDACTED",
        "initials": "TC",
        "avatarHash": null
      },
      "nonPublicAvailable": true
    }
  }

So it seems somehow that a description update is being overwritten without an action being recorded against it.

Hey @bcook any idea how the description could be changing these cases?

Hmm. This seems fishy. Maybe a race condition is occurring? Are all of these changes occurring via the Trello web client?

I’m going to go ahead and open a case for the backend API team to dig into this. I’ll add you to the ticket, @IainDooley as there will likely be follow-up questions.

To time: 2021-01-08T15:18:45.000Z

To time: 2021-01-08T15:17:03.000Z

Those actions are taking place quite close together.

Hey @bcook sorry for the delay, these changes are all occuring via the API. Both the actions are by the same user, who is a “bot” that acts only via the API. So if it were the case that there was some conflict between a user via web clobbering changes made via the API, we should surely see separate actions for each change. In that case I could imagine that the “old” would be the same in both cases, because the “old” that was loaded in the web was the same as that loaded during the API change, but in this case it’s a single user and in both cases the changes are being made via the API.

Even if it were a problem of concurrency, ie. 2 notifications being processed simultaneously, out of order, the “old” desc isn’t being like, posted via the API right? It’s defined as being the state in which the card was prior to the update being sent.

So I’m not sure how there could be a valid situation where the “old” would be the same in 2 consecutive actions with no intervening actions.

Hi @IainDooley, I’ve been looking into this issue and would like to share my findings with you. We think that what’s happening is the two API requests are happening so close together that they’re both loading the original card state at the beginning of the requests. So let’s say we start with desc0. action1 changes the card description to desc1 and action2 changes the card description to desc2. Because both actions seem to be loading the card at the desc0 state, desc0 is being saved as data.old.desc for both actions. The logic in this area is actually quite complex and would take a fair amount of effort to amend.

Are you using the data.old.desc value in your service? If so, are you awaiting the first API request prior to sending off the second? If not, that may be something you could try. Another idea would be to add a one second timeout between receiving the webhook and firing off the second API request.

1 Like

@charley I can’t co-ordinate the 2 requests, they’re originating in different systems, but I think that regardless the take home message is that 2 things are writing to the description and one is writing over the other. The fact that the “old” value is incorrect doesn’t really change the solution from my perspective, it just made it more difficult to diagnose because it just appeared that one of the updates had never happened. Thanks for clarifying, I’ll find a way of avoiding those updates overwriting each other somehow.

Sure thing! Feel free to reach out if you have any other questions :smiley: