Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Opening hours with '\n' in time field #1369

Closed
SiKreuz opened this issue Nov 23, 2020 · 3 comments
Closed

Opening hours with '\n' in time field #1369

SiKreuz opened this issue Nov 23, 2020 · 3 comments

Comments

@SiKreuz
Copy link
Contributor

SiKreuz commented Nov 23, 2020

Steps to Reproduce

  1. Open Opening Hours Activity
  2. Go to the detailed view of a sub section
  3. The time values are sometimes more than just a simple one line string, but with multiple lines and \n. Probably received like that from the API and not properly formatted.

image

Environment

Phone: OnePlus 5T
OS version: OxygenOS 10.0.1
TUM Campus App version: v3.9-dev
Language: German & English

@jlnstrk
Copy link
Contributor

jlnstrk commented Dec 7, 2020

Can confirm it's the server who's at fault here. The newlines within the json vary among literal "\\n", "\/n" and "\n". Both 1 and 2 are essentially wrong following ECMA 404. Number 1 is where this issue appears, number 2 is "fixed" by the weird string-replace stuff happening here.

Gson (correctly) interprets the "\\n" in the json as literal "\n", "\/n" as "/n", and "\n" as an actual newline character. While number 1 probably occurs because of a single escaping backslash too many (in the json source), I don't really see why number 2 would happen, even though it seems to be the most frequent by far.
Other json elements are also affected (like "infos").

@joschahenningsen
Copy link
Member

Opening hours are simply stored in the backend and retrieved by the app, we can easily replace any inconsistencies there I suppose. @SiKreuz you can open this in https://github.com/TUM-Dev/Backend if you want.

@CommanderStorm
Copy link
Member

closing, I created an issue over there

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

No branches or pull requests

4 participants