eyra / mono

Next platform repo
https://eyra.co
GNU Affero General Public License v3.0
7 stars 5 forks source link

Too long project name leads to silent drop of title change #937

Open TjerkNan opened 3 months ago

TjerkNan commented 3 months ago

Describe the bug When I choose an extremely long Project Name, the change is just dropped. I save the change, but the title stays as it was. What happens is that the text is too long for the database and this results in an error.

This is a low prio issue as it's unlikely to be encountered by a researcher/creator, yet maybe proposed fix is simple.

To Reproduce Steps to reproduce the behavior: 1.Change name of project to an extremely long string (not sure where the limit is exactly)

Expected behavior Although we discuss that we don't like limits, there are limits, such as the maximum technical length of a project name due to database record constraint.

Screenshots

Jul 24 13:39:44 ec2-web-dev-01 core[458]: {"time":"2024-07-24T13:39:44.137Z","severity":"error","message":"GenServer #PID<0.28395.1> terminating\n** (Postgrex.Error) ERROR 22001 (string_data_right_truncation) value too long for type character varying(255)\n    (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1\n    (ecto 3.9.5) lib/ecto/repo/schema.ex:756: Ecto.Repo.Schema.apply/4\n    (ecto 3.9.5) lib/ecto/repo/schema.ex:459: anonymous fn/15 in Ecto.Repo.Schema.do_update/4\n    (ecto 3.9.5) lib/ecto/multi.ex:832: Ecto.Multi.apply_operation/5\n    (elixir 1.14.0) lib/enum.ex:2468: Enum.\"-reduce/3-lists^foldl/2-0-\"/3\n    (ecto 3.9.5) lib/ecto/multi.ex:806: anonymous fn/5 in Ecto.Multi.apply_operations/5\n    (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4\n    (db_connection 2.4.3) lib/db_connection.ex:1611: DBConnection.run_transaction/4\nLast message: %Phoenix.Socket.Message{topic: \"lv:phx-F-Ui91BU6C_0-dxy\", event: \"event\", payload: %{\"cid\" => 2, \"event\" => \"submit\", \"type\" => \"click\", \"value\" => %{\"item\" => \"\"}}, ref: \"467\", join_ref: \"415\"}","metadata":{"domain":["otp"],"erl_level":"error","error":{"initial_call":null,"reason":"** (Postgrex.Error) ERROR 22001 (string_data_right_truncation) value too long for type character varying(255)\n    (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1\n    (ecto 3.9.5) lib/ecto/repo/schema.ex:756: Ecto.Repo.Schema.apply/4\n    (ecto 3.9.5) lib/ecto/repo/schema.ex:459: anonymous fn/15 in Ecto.Repo.Schema.do_update/4\n    (ecto 3.9.5) lib/ecto/multi.ex:832: Ecto.Multi.apply_operation/5\n    (elixir 1.14.0) lib/enum.ex:2468: Enum.\"-reduce/3-lists^foldl/2-0-\"/3\n    (ecto 3.9.5) lib/ecto/multi.ex:806: anonymous fn/5 in Ecto.Multi.apply_operations/5\n    (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4\n    (db_connection 2.4.3) lib/db_connection.ex:1611: DBConnection.run_transaction/4\n"},"error_logger":{"report_cb":"&:gen_server.format_log/1","tag":"error"}}}

Desktop (please complete the following information):

MelchiorKokernoot commented 1 week ago

Limiet ligt op 255, wordt wel spuuglelijk; Image

Ik zal ook even een text truncate gebruiken voor de overflow

MelchiorKokernoot commented 1 week ago

Heb de input ge-limit, en truncate gebruikt op de card zodat hij niet meer zo overflowt. Ik kreeg het zo snel nog niet voor elkaar om een mooie validatie-warning te tonen bij >255, maar opzich is het wel duidelijk dat je geen karakters meer kan toevoegen. @mellelieuwes misschien kunnen we volgende week even kijken naar form validatie etc