Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix json escaping #74

Merged
merged 3 commits into from
Nov 19, 2021
Merged

Bugfix: Fix json escaping #74

merged 3 commits into from
Nov 19, 2021

Conversation

MDK5
Copy link
Contributor

@MDK5 MDK5 commented Nov 18, 2021

Motivation, Context and Description

Fixes #73.

The problem is caused by insuffiecient escaping. Gson correctly escapes the quotes inside the string as \", but for reasons I do not understand, the artemis connector receives all quotes as \", both inside the string and the ones part of the json. Therefore it cannot distinguish them anymore and the parsing crashes, leading to the described bug. To counter this, all backslashes get replaced by double backslashes before sending the data to the connector.

Also comments breaking changes regarding the testRun flag that would otherwise cause syncronisation issue with Orion's and Artemis's releases.

Steps for Testing

  1. Install the release as described in the readme
  2. Test with the latest develop
  3. Assess an exercise
  4. Add all sorts of special characters into the feedback
  5. Verify the feedback gets stored correctly on the server, e.g. by opening the same submission in the browser

@MDK5 MDK5 self-assigned this Nov 18, 2021
Copy link

@lschlesinger lschlesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it with providing feedback including several backslashes and other non-character signs. The feedback shown in Artemis showed the feedback string without any changes. Solution works well to fix the issue 👍

Copy link

@willergeorg willergeorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes lgtm.

Copy link

@Malyuk-A Malyuk-A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested during testing session. Used locale Orion version. Code was explained and seems to work fine.

@krusche krusche merged commit 9b916d3 into master Nov 19, 2021
@krusche krusche deleted the bugfix/fix-json-escaping branch November 19, 2021 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assessment line comment strings are not html escaped
5 participants