Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Bug: 4th Problem Saving Issues on Problem Edit #1620

Open
alexrcabral opened this issue Jan 5, 2021 · 8 comments
Open

Bug: 4th Problem Saving Issues on Problem Edit #1620

alexrcabral opened this issue Jan 5, 2021 · 8 comments
Labels

Comments

@alexrcabral
Copy link

alexrcabral commented Jan 5, 2021

The EdReady SME has reported a bug regarding the saving of a fourth problem when editing the problem set.

EdReady Video of Bug Occurring: https://www.loom.com/share/9ccbd97a93a24f908f3a33e1880c6cb2
Link to Problem Shown in the Video: https://mathshare.benetech.org/#/app/problemSet/edit/AVLF2F6F6WPFK

I have not yet been able to replicate this bug. I’ve tried creating a four problem set, saving three problems + adding a fourth, changing settings, and adding work, but so far it’s all been saving normally. @bognasoldev89 Could you try to replicate the bug shown in the video?

Problems which he reports having the same issue:

Note: There's also some odd behavior around the settings (e.g. the toggles flipped when I toggled "Include my work when sharing" to on), but I'm not sure if it's related. Filing a separate bug for that.

@johnhbenetech
Copy link
Member

@bognasoldev89 you can disregard as I was able to reproduce it.

@alexrcabral @rupeshparab
I believe it may be related to the content being very large, related error is below. So it's basically the pasted problem prompt is over character limit (255). the "4th problem" thing is a red herring

So @alexrcabral i think the options are either:

  • Increase the length limit of the description in the database (or remove it entirely)
  • Add front end validation that either halts entry at the character limit or does the twitter thing where it tells you how many characters you have to remove.
2021-01-04 18:15:21.755 ERROR 15 --- [nio-8081-exec-1] o.h.e.j.s.SqlExceptionHelper             : ERROR: value too long for type character varying(255)
2021-01-04 18:15:21.755 ERROR 15 --- [nio-8081-exec-1] o.h.e.j.s.SqlExceptionHelper : ERROR: value too long for type character varying(255)
2021-01-04T12:15:21.768-06:00	2021-01-04 18:15:21.764 ERROR 15 --- [nio-8081-exec-1] 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
2021-01-04T12:15:21.768-06:00	org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
2021-01-04T12:15:21.768-06:00	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433) ~[postgresql-42.2.2.jar!/:42.2.2]
2021-01-04T12:15:21.768-06:00	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178) ~[postgresql-42.2.2.jar!/:42.2.2]
2021-01-04T12:15:21.768-06:00	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306) ~[postgresql-42.2.2.jar!/:42.2.2]
2021-01-04T12:15:21.768-06:00	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) ~[postgresql-42.2.2.jar!/:42.2.2]
2021-01-04T12:15:21.768-06:00	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) ~[postgresql-42.2.2.jar!/:42.2.2]
2021-01-04T12:15:21.768-06:00	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155) ~[postgresql-42.2.2.jar!/:42.2.2]

@alexrcabral
Copy link
Author

Thanks @johnhbenetech! Good to know that the issue is stemming from the character limit.

Those are good suggestions -- I think a combination of the two would address it well:

  • The character length should be increased to 2,000 characters
  • Front end validation should be added to halt entry after 2,000 characters is reached

@alexrcabral alexrcabral removed their assignment Jan 5, 2021
@johnhbenetech
Copy link
Member

@alexrcabral I moved to backlog, can you make sure priority is right

@alexrcabral
Copy link
Author

Great, thanks @johnhbenetech! I've updated its priority so the backlog should be in order now

rupeshparab added a commit that referenced this issue Jan 10, 2021
rupeshparab added a commit that referenced this issue Jan 10, 2021
rupeshparab added a commit to benetech/MathShareBackend that referenced this issue Jan 10, 2021
@rupeshparab
Copy link
Collaborator

this issue should be fixed on QA now

@abaranowska1
Copy link

Tested
Confirmed that I can create a problem set where the prompt is over 255 characters I tried with 300,1000,2000 and more ( all copied ) and all work fine for me, but I think that when we have a longer prompt we should wrap the text because it will be more readable. @alexrcabral What do you think?
Peek 2021-01-14 15-41

@alexrcabral
Copy link
Author

Thanks @abaranowska1 -- it looks like it's overflowing properly when there are breaks between words, but a single long word with many many characters is breaking it. It would be good to allow for overflow when spaces aren't available.

Screen Shot 2021-01-14 at 5 28 40 PM

Currently it's not halting entry after 2,000 characters is reached. It allows for entry of greater than 2,000 characters, then throws an error if you click "Add Problem".

Screen Shot 2021-01-14 at 5 29 43 PM

Next Steps:

  • Halting entry after 2,000 characters should be fixed (to clarify, this should prevent from entering further text, allow for backspacing)
  • Allow for overflow between characters in a single word lacking spaces, when there are 1) no spaces in a given line, and 2) it would otherwise exceed the horizontal space on the web page

rupeshparab added a commit that referenced this issue Feb 4, 2021
rupeshparab added a commit that referenced this issue Feb 4, 2021
@rupeshparab
Copy link
Collaborator

Added both the fixes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants