viadee / sonarQuest

A playful approach to refactoring code smells
https://www.viadee.de/sonarquest
BSD 3-Clause "New" or "Revised" License
116 stars 28 forks source link

Quest creation not possible #216

Closed Christoph-Meyer closed 5 years ago

Christoph-Meyer commented 5 years ago

Reproduce:

  1. Create a world as admin, call issues from SonarQube
  2. Assign players and a gm
  3. Try to create a quest as a gm with a story more then 255 Chars long - EXCEPTION

See log:

2019-04-24 16:37:35.295 ERROR [sQ,01165232567f5def,01165232567f5def,false] 8084 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement] with root cause

org.h2.jdbc.JdbcSQLException: Wert zu gross / lang f├╝r Feld "STORY VARCHAR(256)": "STRINGDECODE('Der Tag ist sch\u00f6n, die V\u00f6gel singen und in der kleinen Hafenstadt Laies am Langen Meer d\u00fcmpeln die ... (315)" Value too long for column "STORY VARCHAR(256)": "STRINGDECODE('Der Tag ist sch\u00f6n, die V\u00f6gel singen und in der kleinen Hafenstadt Laies am Langen Meer d\u00fcmpeln die ... (315)"; SQL statement: insert into event (id, headline, image, state, story, timestamp, title, type, user_id, world_id) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?) [22001-197] at org.h2.message.DbException.getJdbcSQLException(DbException.java:357) ~[h2-1.4.197.jar!/:na] at org.h2.message.DbException.get(DbException.java:179) ~[h2-1.4.197.jar!/:na] at org.h2.table.Column.validateConvertUpdateSequence(Column.java:398) ~[h2-1.4.197.jar!/:na] at org.h2.table.Table.validateConvertUpdateSequence(Table.java:798) ~[h2-1.4.197.jar!/:na] at org.h2.command.dml.Insert.insertRows(Insert.java:177) ~[h2-1.4.197.jar!/:na] at org.h2.command.dml.Insert.update(Insert.java:134) ~[h2-1.4.197.jar!/:na] at org.h2.command.CommandContainer.update(CommandContainer.java:102) ~[h2-1.4.197.jar!/:na] (snip)

Christoph-Meyer commented 5 years ago

@CINO-DE I would recommend cutting the quest text to 250 Chars when inserting into "Events" and adding a few "..." in the end. Thoughts?

fkoehne commented 5 years ago

What about the http://www.h2database.com/html/datatypes.html#clob_type?

Christoph-Meyer commented 5 years ago

CLOB could be a possibility, but I do not like the thought of the events getting too big. The "real" event descriptions are inserted into the chat-like area and thus should encourage to open the matching "item", like the quest in the quest view.