Closed dleard closed 1 year ago
There's a bug right now where you can't upload more than one attachment. It's because of the unique index on the attachment table:
{"errors":[{"errcode":"23505","extensions":{"exception":{"errcode":"23505"}},"message":"duplicate key value violates unique constraint \"attachment_application_id_version_number_key\"","locations":[{"line":4,"column":3}],"path":["createAttachment"],"stack":["error: duplicate key value violates unique constraint \"attachment_application_id_version_number_key\""," at Parser.parseErrorMessage (/home/briannacerkiewicz/cas-ciip-portal/app/node_modules/pg-protocol/dist/parser.js:278:15)"," at Parser.handlePacket (/home/briannacerkiewicz/cas-ciip-portal/app/node_modules/pg-protocol/dist/parser.js:126:29)"," at Parser.parse (/home/briannacerkiewicz/cas-ciip-portal/app/node_modules/pg-protocol/dist/parser.js:39:38)"," at Socket.<anonymous> (/home/briannacerkiewicz/cas-ciip-portal/app/node_modules/pg-protocol/dist/index.js:10:42)"," at Socket.emit (events.js:400:28)"," at Socket.emit (domain.js:475:12)"," at addChunk (internal/streams/readable.js:293:12)"," at readableAddChunk (internal/streams/readable.js:267:9)"," at Socket.Readable.push (internal/streams/readable.js:206:10)"," at TCP.onStreamRead (internal/stream_base_commons.js:188:23)"]}],"data":{"createAttachment":null}}
Could be fixed as part of this PR
@BCerki I'm getting an "Internal Server Error" message when deleting an attachment - would you mind walking me through this?
@pbastia , seems to be at least partly an nginx thing, will look at it tomorrow with dleard
Thank you @BCerki ! We might want to put this card back in the development column then
Everything works very smoothly @BCerki ! Thanks so much for the hard work.
This card is a continuation of #2126. The initial work of allowing uploads was completed, but there were some outstanding issues that needed solving before it could be considered complete. The incomplete work was merged to unblock #2181.
Issues to be resolved by this card:
For the constraints, we should have some info text that tells the user the format and size requirements. We also have a react-toastify package that can show some pop-up errors with messages about type/size if they attempt to upload something that doesn't satisfy our constraints.
Acceptance Criteria:
application/pdf