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

Markdown analytics are wrong when editing a homework. #1115

Closed
Jonas-Sander opened this issue Oct 6, 2023 · 0 comments · Fixed by #1127
Closed

Markdown analytics are wrong when editing a homework. #1115

Jonas-Sander opened this issue Oct 6, 2023 · 0 comments · Fixed by #1127
Labels
bug Something isn't working. feature: analytics Includes everything that is related to analytics and usage tracking feature: homework w: add-homework-page Creation Dialog of a homework. Get to it by pressing the add homework button on the homework page.

Comments

@Jonas-Sander
Copy link
Collaborator

Jonas-Sander commented Oct 6, 2023

Describe the bug

When editing a homework and not using markdown in the new description a "markdown_used" analytics event is logged regardless.

Steps to reproduce the bug

  1. Go to homework creation page
  2. Create a homework with the description: "no markdown"
  3. Edit the homework and change the description to "still no markdown"
  4. Save edited homework.

Current broken behavior

A markdown_used-event is logged.

Expected behavior

No markdown_used-event should be logged.

Screenshots, videos or logs

Tested device

  • App version: 1.7.9

Additional context

Possible solution

@Jonas-Sander Jonas-Sander added bug Something isn't working. feature: homework w: add-homework-page Creation Dialog of a homework. Get to it by pressing the add homework button on the homework page. feature: analytics Includes everything that is related to analytics and usage tracking labels Oct 6, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 9, 2023
Continuation of #1113.

* Added a test for editing a homework
* Move analytics from the UI into the bloc.
* Remove `oldHomework` from `bloc.submit` because it's unnecessary.
* Change bloc method: `bool isValid()` to `void validateInputOrThrow()`.

I'm trying to not change logic in the refactorings, so that structural
and behavioral changes are seperated. This is why I'm leaving this
broken behavior in for now #1115.
github-merge-queue bot pushed a commit that referenced this issue Oct 25, 2023
Replaced `HomeworkDialogBloc` with a `Bloc` from
[package:bloc](https://pub.dev/packages/bloc).
Added unit and golden tests.

I tried to keep the behavior mostly the same. There are still some of
the same bugs as before (e.g. #1117), they should be fixed in separate
PRs.

Differences to old behavior:
* If any field is changed the quit prompt will appear (e.g. submission
enabled, submission time and is private were ignored before)
* Pressing save will show errors (red text) like before, but not a
`SnackBar`

Not so great:
* `PrefilledTextField` will we rebuild each time the text changes
(title, description) - didn't see any problems because of this though
* Code quality is mediocre (e.g. using `HomeworkDto` for the current
state in the bloc which lead to _horrible_ hacks for the todo
`DateTime`)
* Quality of tests if mediocre, good amount of duplication. Also instead
of testing each thing seperately I threw some different scenarios
(private, not private, with submissions) together which just tested
different things at the same time.
* Markdown analytics not tested automatically, just manually once
* No automatic tests for awaiting or not awaiting API calls depending on
if attachments are added because of the Firestore offline behavior where
Future won't complete (it works though, tested it manually several
times)

Good:
* Good amount of test coverage
* Several golden tests (happy path and errors)
* UI is decoupled from business logic
* Should be a bit better to add functionality and maintain than before
* 🗿


https://github.com/SharezoneApp/sharezone-app/assets/29028262/86ef445f-2424-4607-b3fc-d403d70eafa2


https://github.com/SharezoneApp/sharezone-app/assets/29028262/64332530-0181-4bbf-8a35-d31e62405bc8

Fixes #1115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. feature: analytics Includes everything that is related to analytics and usage tracking feature: homework w: add-homework-page Creation Dialog of a homework. Get to it by pressing the add homework button on the homework page.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant