lebenswurzel / solawi-bedarf

Eine App für die Produktverwaltung und Bedarfsanmeldung in einer SoLawi
GNU Affero General Public License v3.0
2 stars 0 forks source link

Internal Server Error after invalid data entry #116

Closed haflex closed 1 month ago

haflex commented 1 month ago

While editing a shipment a "'Internal Server Error" was discovered. The log of the backend service filed the following message

Oct 16 15:26:03 dusty plantage-be-start[8796]:   QueryFailedError: invalid input syntax for type integer: "1.5"
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at PostgresQueryRunner.query (/nix/store/9vpj74k0fv0rpggrvcbax6119xljil9m-solawi-beda>
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at processTicksAndRejections (node:internal/process/task_queues:95:5)
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at async InsertQueryBuilder.execute (/nix/store/9vpj74k0fv0rpggrvcbax6119xljil9m-sola>
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at async SubjectExecutor.executeInsertOperations (/nix/store/9vpj74k0fv0rpggrvcbax611>
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at async SubjectExecutor.execute (/nix/store/9vpj74k0fv0rpggrvcbax6119xljil9m-solawi->
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at async EntityPersistExecutor.execute (/nix/store/9vpj74k0fv0rpggrvcbax6119xljil9m-s>
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at async saveShipment (/nix/store/9vpj74k0fv0rpggrvcbax6119xljil9m-solawi-bedarf-back>
Oct 16 15:26:03 dusty plantage-be-start[8796]:       at async bodyParser (/nix/store/9vpj74k0fv0rpggrvcbax6119xljil9m-solawi-bedarf-backen>

Christina says that she entered a 1,5 in the "multiplikator" field.

joergrs commented 1 month ago

Thanks for filing this issue. The problem is that the "conversion to" field only accepts integer inputs. Values with a comma are not allowed.

I know the shipment dialog is a bit unintuitive, but if you already select a mulitplicator of "1.5x" it is not necessary to also specify the from/to-conversion as "1 -> 1.5".

I think we need better validation in the shipment dialog. But as we already plan to overhaul it completely in #38, I don't think a change is necessary in the short term.

I hope it's ok if I close the issue for know. Otherwise, feel free to post here again.

P.S.: When filing an issue please also mention the version you are using (see the footer of the app) and make sure the tracebacks are full length and also contain the line numbers.