Sending an empty array to clear a file column?

Similar to Bug fix: Sending an empty array to clear a dropdown column from @rachelatmonday, I thought I’d try to manipuate some file columns.

Using the following mutation:

mutation (
    $board_id: ID!
    $item_id: ID!
    $column_values: JSON!
) {
  change_multiple_column_values(
    board_id: $board_id
    item_id: $item_id
    column_values: $column_values
  ){
    id
  }
}

With the following variables:

{
  "board_id": 1540573903,
  "item_id": 1540573945,
  "column_values": "{\"files__1\":[],\"files_1__1\":[]}"
}

This returns a success & empties the files columns in the UI, but if you reload the page, the files return.

:raising_hand_woman: Whats happening?


Here’s a Loom demo:

Ok, there’s documentation on clearing columns of type file:

hat tip: @anon29275264

Still seems a bit odd that an empty array will change the files in the UI, even momentarily.

@dvdsmpsn would you do a test in the “cleared but not cleared” state and drag a file into the column and see what happens?

@anon29275264 If you drop a file into the column, it uploads and displays that file only in the column.

On page refresh, all the other files are there too.

Alright. I was wondering if since the UI had an empty array, if adding the file added just that file to the array and saved that array in some fashion causing the “hidden” files to vanish. That would be really bad - and a bug.

@anon29275264 @Matias.Monday This is certainly a bug, even if it is less serious than you considered it could be.

The API is returning an update successful on columns, whereas it’s not actually successful.

I don’t disagree, the current behavior is a bug.

File columns are definitely strange! Glad we were able to solve for the correct way to clear the column. Surprised just a “null” doesn’t clear it like every other column though… I thought all column types were supposed to now be clearable with a null.

Hello there @dvdsmpsn !

Would you be able to please fill this form explaining the possible bug you mention with as much information as possible so our team can take a look?

1 Like