Bug: Sync table auto-edit sends stale value for Attachment columns (race condition with file upload

hi @Eric_Koleda

I ran into a race condition with mutable Attachment columns in two-way sync tables when using “send edits immediately” mode.

Setup:

  • Sync table with a mutable Attachments column (codaType: ValueHintType.Attachment, single or array doesn’t matter)
  • “Send edits immediately” enabled (the default for our users and the only way sync tables experience is tolerable)

Steps to reproduce:

  1. Drop a file into the Attachments cell
  2. Coda begins uploading the file to codahosted.io
  3. Auto-edit fires before the upload finishes
  4. executeUpdate receives an empty string for the attachment field, not the codahosted URL

What I expected:
Auto-edit should wait for the file upload to complete before firing, so executeUpdate receives the codahosted URL.

What actually happens:
The edit is sent immediately. If the file is small enough to upload before the auto-edit debounce triggers, and if you’re lucky, it works fine — the codahosted URL arrives in
newValue. But for larger files (anything more than a few kb), the upload loses the race and the pack receives "".

Could this addressed?

2 Likes