Card description is replaced by template card description after changing it
See original GitHub issueDescribe the bug The card description (main text) is replaced by the template card description shortly after setting a custom description.
To Reproduce I don’t know a way to exactly reproduce the error, but it has been reported more than once by our users. It affects a certain kind of card for us, but so far I do not know what makes it special.
The basic process is as follows:
- Copy card from a template (which also has a description)
- Set name, description and position
- Upload an attachment
- Set custom fields
Expected behavior The description set in step 2 stays.
Desktop (please complete the following information):
- OS: Windows Server
- .NET Framework 4.6.2
- Manatee.Trello 3.10, Manatee.Json 10.1.3
Additional context
-
No changes to the config except
TrelloConfiguration.ThrowOnTrelloError = true;
-
The code creating the copy follows. The code snippet refers to
message
which contains this deserialized bit of data:{ "BoardId": "4f2ef2f82e7ecf843fb79644", "ListId": "52ce972a1c855c5a309edd85", "TemplateCardId": "58eb98323a7c5202d3f48a28", "Title": "the title that stays", "Description": "this is the description that should stay", "Attachments": { "$type": "Ops.Contracts.Model.Trello.Attachment[], Ops.Contracts", "$values": [ { "Name": "some file.yaml", "BinaryData": "some data" } ] }, "Fields": { "$type": "Ops.Contracts.Model.Trello.Mapping[], Ops.Contracts", "$values": [ { "Data": "2019-09-19T11:24:24.5704536+02:00", "FieldName": "some date" } ] } }
var board = _trello.Board(message.BoardId); await board.Lists.Refresh(); var list = board.Lists[message.ListId]; var cards = list.Cards; ICard card; if (message.TemplateCardId != null) { card = await cards.Add(_trello.Card(message.TemplateCardId), CardCopyKeepFromSourceOptions.All); } else { card = await cards.Add(message.Title); } card.Name = message.Title; card.Description = message.Description; card.Position = Position.Top; var tasks = message.Attachments? .ToList() .Select(x => card.Attachments.Add(x.BinaryData, x.Name)); if (tasks != null) { await Task.WhenAll(tasks); } await MapFields(message, board, card);
MapFields
is responsible to set custom field values and to transform data types. No errors are logged.
To debug this issue further, is there a way to force a flush of in-memory card data to the Trello API or to force a re-read from the Trello API?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:23 (9 by maintainers)
@gregsdennis The workaround you provided appears to have fixed our problems with the card descriptions. I’m in favor of keeping this issue open and hopefully find a solution that does not require to change Manatee.Trello’s internal optimizations.
@agross any luck?