Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submissions with attachments with unicode filenames are not saved #433

Closed
yanokwa opened this issue May 18, 2023 · 9 comments · Fixed by getodk/central-backend#908
Closed
Assignees
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified bug

Comments

@yanokwa
Copy link
Member

yanokwa commented May 18, 2023

If you have an Enketo file submission with unicode (e.g., é) the submission will go through fine, but when you try to edit the data, you'll see...

Screenshot 2023-05-18 at 10 27 17

In the DB, I see that the blobs have no ID.

central=> select * from submission_attachments where "submissionDefId" = 180867;
 blobId |       name        | submissionDefId | index | isClientAudit
--------+-------------------+-----------------+-------+---------------
  14316 | file1-10_11_1.bin |          180867 |       | f
        | fîlé2-10_11_6.bin |          180867 |       | f
        | f😂le3-10_11_9.bin |          180867 |       | f

central=> select id,"contentType" from blobs where id = null;
 id | contentType
----+-------------
(0 rows)

The form and files I used to do the above are here:

This does not happen in Collect because files are renamed to a timestamp before upload.

@yanokwa
Copy link
Member Author

yanokwa commented May 18, 2023

@eyelidlessness This isn't an Enketo bug. I'm tagging you for visibility.

@matthew-white
Copy link
Member

Notes for the QA team

This issue can be tested using a form with a media field. This issue only comes up in Enketo, but it'd be great to verify that a submission from Collect also continues to work.

@yanokwa
Copy link
Member Author

yanokwa commented May 31, 2023

@getodk/testers Please be sure to also check special characters like (, _, # and the like.

@dbemke
Copy link

dbemke commented Jun 1, 2023

I don't know if this is in the scope of this PR when the file name contains a symbol (that shouldn't contain) like $ then while editing the user sees missing image and is able to download the file (which is broken).

Image

@sadiqkhoja
Copy link
Contributor

File is downloadable from the Submission table:

image

When I click on download icon on submission table, backend receives this request:

/v1/projects/473/forms/build_media_1556624635/submissions/uuid%3Abe2af264-615d-4658-afa5-385158ede558/attachments/%24dollar-8_45_1.jpg

However, URL in Enketo is /-/media/get/1/uuid:be2af264-615d-4658-afa5-385158ede558/%24dollar-8_45_1.jpg and it is not sending any request to backend.

This looks like Enketo issue

@dbemke
Copy link

dbemke commented Jun 1, 2023

We finished testing other characters so please let us know if the issue above will be fixed as a separate so that we can remove the needs testing label.

@matthew-white
Copy link
Member

Yes, that will be fixed separately in Enketo, so we can remove the "needs testing" label here. Thank you for finding that issue!

@srujner
Copy link

srujner commented Jun 2, 2023

Tested with Success!

1 similar comment
@dbemke
Copy link

dbemke commented Jun 2, 2023

Tested with Success!

@dbemke dbemke added behavior verified Behavior has been manually verified and removed needs testing Needs manual testing labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified bug
Projects
Status: ✅ done
5 participants